基礎更新流程
sudo apt update
sudo apt upgrade
(不自動處理依賴變更)sudo apt full-upgrade
(推薦用于系統級更新)自動更新配置
sudo apt install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
,選擇“Yes”/etc/apt/apt.conf.d/50unattended-upgrades
調整更新策略清理與優化
sudo apt autoremove
sudo apt clean
安全增強建議
--no-install-recommends
)ufw
,僅開放必要端口(如SSH 22)注意事項:更新前建議備份關鍵數據,網絡受限環境可搭建本地鏡像倉庫。
參考來源: