我通常使用apt-get update && apt-get upgrade来运行我的更新和升级,而不是GUI,因为它似乎运行得更快。
然而,我最近注意到,我经常收到一条信息,说我的一次升级被阻止了。然后,我通常运行dist-upgrade来执行它,并且它工作得很好。据我所知,在阅读了这个问题及其答案之后,dist-upgrade做了所有相同的事情,然后做了一些事情。
所以,我的问题是:为什么要使用apt-get upgrade呢?为什么不一直使用apt-get dist-upgrade呢?为什么apt-get upgrade会存在?
发布于 2012-12-06 17:02:15
我通常用以下方法升级我的机器:
sudo apt-get update && time sudo apt-get dist-upgrade下面是man apt-get的摘录。使用升级符合规则:在任何情况下,当前安装的包都不会被移除,或者尚未安装的包将被检索和安装。如果这对您很重要,请使用apt-get upgrade。如果您希望事情“只起作用”,您可能希望apt-get dist-upgrade确保解决依赖关系。
要扩展为什么要升级而不是dist升级,如果您是系统管理员,则需要可预见性。您可能正在使用诸如apt钉扎之类的高级特性,或者从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.发布于 2014-07-22 05:22:17
我知道这个问题已经回答了,而且已经一岁了,但我觉得这是有必要说的。Ubuntu14.04及更高版本(以及Debian及更高版本,对于那些从Google中发现这一点的人)使用APT1.0,它允许命令apt而不是apt-get和apt-cache用于某些操作。
apt-get upgrade不会更改安装的内容(仅版本),apt-get dist-upgrade将根据需要安装或删除包以完成升级,apt upgrade将自动安装但不删除软件包。apt full-upgrade执行与apt-get dist-upgrade相同的功能。发布于 2012-09-30 06:17:04
upgrade选项只安装系统上已经安装的包的新版本(是的,内核更新属于它们)。
但是,有时更新会改变依赖关系:例如,包的新版本将不再依赖您已经安装的库,或者需要安装其他库。upgrade选项将永远不会删除您不再需要的已安装的包。
但是,dist-upgrade选项可以“智能”地处理依赖关系系统中的更改。这包括删除不再必要的包或解决因依赖项的更改而引起的包之间的冲突。
https://askubuntu.com/questions/194651
复制相似问题