sudo apt update
:获取最新软件包信息。sudo apt upgrade
:安装所有可用的更新(不升级到新版本)。sudo apt full-upgrade
:升级到最新版本(含新功能和安全补丁)。sudo apt autoremove
:删除不再需要的依赖包。sudo apt clean
:清除下载的软件包缓存。/etc/apt/sources.list
,将发行版代号(如bullseye
)替换为目标版本代号(如bookworm
)。sudo apt update && sudo apt dist-upgrade
:升级系统到新版本。sudo reboot
:使升级生效。sudo apt install unattended-upgrades
。sudo dpkg-reconfigure unattended-upgrades
:选择“Yes”启用。sudo systemctl status apt-daily.timer
和 sudo systemctl status apt-daily-upgrade.timer
。sudo unattended-upgrade --dry-run
:模拟升级过程。/var/log/apt/
下的日志,了解更新情况。以上步骤参考自,可根据实际需求选择手动或自动更新方式。