我通常会对我的机器进行升级,包括:
sudo apt-get update && time sudo apt-get dist-upgrade
以下是来自
man apt-get
的摘录。使用升级命令遵循一个规则:绝不会删除当前已安装的软件包,也不会获取和安装尚未安装的软件包。如果这对你很重要,使用
apt-get upgrade
。如果你希望一切“顺利进行”,你可能需要
apt-get dist-upgrade
来确保解决依赖关系。
进一步解释为什么你应该选择
upgrade而不是
dist-upgrade,如果你是系统管理员,你需要可预测性。你可能正在使用高级功能,比如
apt pinning或从一组
PPAs中提取(也许你有一个内部PPA),并且有各种自动化机制来检查你的系统和可用的升级,而不总是急于升级所有可用的软件包。当apt执行非脚本行为时,特别是如果这导致生产服务停机,你会感到非常沮丧。
upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in
/etc/apt/sources.list. Packages currently installed with new
versions available are retrieved and upgraded; under no
circumstances are currently installed packages removed, or packages
not already installed retrieved and installed. New versions of
currently installed packages that cannot be upgraded without
changing the install status of another package will be left at
their current version. An update must be performed first so that
apt-get knows that new versions of packages are available.
dist-upgrade
dist-upgrade in addition to performing the function of upgrade,
also intelligently handles changing dependencies with new versions
of packages; apt-get has a "smart" conflict resolution system, and
it will attempt to upgrade the most important packages at the
expense of less important ones if necessary. So, dist-upgrade
command may remove some packages. The /etc/apt/sources.list file
contains a list of locations from which to retrieve desired package
files. See also apt_preferences(5) for a mechanism for overriding
the general settings for individual packages.
sudo apt full-upgrade
执行类似的操作。 - Aaron Franke