apt-get upgrade和dist-upgrade的差别

upgrade:系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来.

dist-upgrade:可以聪明的解决相依性的问题,如果有相依性问题,需要安装/移除新的Package,就会试着去安装/移除它. (所以通常这个会被认为是有点风险的升级)

man apt-get的解释:

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

*******************************************************************
apt-get upgrade

即从 /etc/apt/sources.list 提供的源同步软件版本索引,并将本地软件版本升级到最新。

但并不总是如此。

有时您在升级系统时会发现某些软件并没有更新到最新版本,而是被"kept-back"了.

哪里出现了问题呢?
这是因为 当本地软件包的最新版本的依赖关系发生了变化, 引入新的软件包时, apt-get upgrade 并不能将此软件包升级到最新,而是提示软件包被"kept-back".

要解决这类问题您需要运行如下命令:

apt-get dist-upgrade

这样就会将软件包升级到最新版本, 并安装新引入的依赖包。

在apt-get manpage 的 dist-upgrade 部分做如下解释:

dist-upgrade 除了提供upgrade 的全部功能外,并智能处理新版本的依赖关系问题。 apt-get提供一个“智能”的系统冲突解决方案,必要时可能以牺牲某些非重要软件包为代价来升级某些非常重要的软件包。

所以 您在使用apt-get dist-upgrade 应当小心, 明白您自己在做什么, 否则 后果自负噢! :)

你可能感兴趣的:(apt-get upgrade和dist-upgrade的差别)