skip to content
Logo 大狗子博客

debian11升级到debian12

/ 1 min read

第一步: 更新系统到最新

apt update
apt upgrade -y
apt dist-upgrade -y

第二步: 更新debian12源

cat > /etc/apt/sources.list << EOF
deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main
deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib
EOF

第三步: 再次更新系统

apt update
apt upgrade -y
apt dist-upgrade -y

第四步: 重新启动

reboot

第五步: 查看系统版本

lsb_release -a

第六步: 删除无用依赖

apt autoclean
apt autoremove -y