Debian系統版本升級步驟如下:
rsync
或tar
備份重要文件,避免升級失敗導致數據丟失。cat /etc/debian_version
或lsb_release -a
。sudo apt update
。sudo apt upgrade -y
。sudo apt dist-upgrade -y
。sudo apt autoremove -y
。/etc/apt/sources.list
及/etc/apt/sources.list.d/
下的舊版本代號(如bullseye
)替換為新版本代號(如bookworm
),推薦使用DEB822格式。sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list
sudo apt update
。sudo apt full-upgrade
,按提示處理配置文件沖突。sudo reboot
,確保內核及服務正常加載。lsb_release -a
或cat /etc/debian_version
,確認已升級到目標版本。sudo apt autoclean
,刪除舊包緩存。參考來源: