'apt-get upgrade' 和 'apt-get install --only-upgrade' 的区别

直到今天,我一直以为使用“apt-get upgrade”命令可以将所有已安装的软件包升级到最新版本。然而,今天我意识到我的“deluged”软件包版本是1.3.6,而有一个更新的版本1.3.11。使用“apt-get upgrade”命令没有起作用,后来我发现可以使用“apt-get install --only-upgrade”命令,但这只适用于特定的软件包。
为什么在我的情况下“upgrade”命令没有起作用?有没有办法确保所有软件包都得到升级?
谢谢!

你解决了吗?我也有同样的问题。 - p4sh4
1个回答

你想要使用 apt-get dist-upgrade 来完成这个任务。
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

1为什么有些软件包需要进行“dist-upgrade”升级? - Pigeonaras
一般升级时,在执行 apt-get update 之后,使用 dist-upgrade 命令可以处理所有软件包的升级以及它们的依赖关系。 - Howard Krause
或许dist-upgrade能够进行更深层次的升级,因为它实际上是升级操作系统,或许某个库的n+1版本需要对操作系统库进行特定更改,否则可能会出现错误。只是猜测而已。 - Purefan