debian 9升级到debian 10

Debian Buster 以上版本默认支持 HTTPS 源。如果遇到无法拉取 HTTPS 源的情况,请先使用 HTTP 源并安装:

apt install -y apt-transport-https ca-certificates

step1:更新一下 或者 换源地址 更新 完了 重启一下

apt update -y && apt upgrade -y
deb http://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb http://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main non-free contrib
#deb http://mirrors.aliyun.com/debian-archive/debian stretch-backports main non-free contrib
deb http://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
#deb-src http://mirrors.aliyun.com/debian-archive/debian stretch main contrib non-free
#deb-src http://mirrors.aliyun.com/debian-archive/debian stretch-proposed-updates main contrib non-free
#deb-src http://mirrors.aliyun.com/debian-archive/debian stretch-backports main contrib non-free
#deb-src http://mirrors.aliyun.com/debian-archive/debian-security stretch/updates main contrib non-free
reboot

更新缓存

apt clean all
apt update

step2:备份一份

cp /etc/apt/sources.list /etc/apt/sources.list.orig

step3:将/etc/apt/sources.list里所有“stretch”替换为“buster” 或者直接编辑文件换debian10源

sed -i 's/stretch/buster/g' /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

step4:再更新一下

apt update -y && apt upgrade -y

step5:执行升级命令

apt dist-upgrade

step6:提示完成后重启

reboot

step7:查看下当前debian版本

lsb_release -a
sanradar
sanradar
文章: 103