Debian jessie升级至buster

注意:不要跨版本升级,需要逐版本升级。

备份数据

升级前请做好备份操作,防止升级后相关服务不可用或数据无法正常读取。

  1. 程序代码
  2. 数据库文件
  3. 配置文件,如:Nginx、MySQL、PHP等
  4. 系统添加的用户和SSH Key等。
说明,下面操作建议使用root账号。

更新当前系统

apt-get update
apt-get upgrade
apt-get dist-upgrade

# 更新好后,建议重启下
reboot

升级至stretch

替换软件源

# 备份软件源
cp /etc/apt/sources.list /etc/apt/sources.list_bak

# 替换jessie为stretch
sed -i 's/jessie/stretch/g' /etc/apt/sources.list

替换后sources.list内容:

deb http://mirrors.ustc.edu.cn/debian stretch main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security stretch/updates main contrib non-free

更新软件包和升级系统

# 执行apt-get update可能会出现类似:There is no public key available for the following key IDs: 8B48AD6246925553的错误
# 安装debian-archive-keyring进行修复
apt-get install debian-archive-keyring

# 更新并升级系统
apt-get update
apt-get upgrade
apt-get dist-upgrade

# 重启
reboot

清理无用或废弃软件

apt-get autoremove
apt-get autoclean
apt-get clean

升级至buster

替换软件源

# 替换stretch为buster
sed -i 's/stretch/buster/g' /etc/apt/sources.list

替换后sources.list内容:

deb http://mirrors.ustc.edu.cn/debian buster main contrib non-free
deb http://mirrors.ustc.edu.cn/debian buster-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security buster/updates main contrib non-free

更新软件包和升级系统

# 更新并升级系统
apt-get update
apt-get upgrade
apt-get dist-upgrade

#重启
reboot

清理无用或废弃软件

apt-get autoremove
apt-get autoclean
apt-get clean

参考文章:

How To Upgrade Debian 8 Jessie To Debian Linux 9 Stretch
Debian 8 Jessie 升级至 Debian 9 Stretch 教程
Debian:如何从Jessie升级为Buster(Debian 8.0 升级到Debian 10.0)

标签: linux

仅有一条评论

  1. 不错不错哦~~~

添加新评论