update (apt-get(8))
update is used to download package information from all configured
sources. Other commands operate on this data to e.g. perform
package upgrades or search in and display details about all
packages available for installation.
upgrade (apt-get(8))
upgrade is used to install available upgrades of all packages
currently installed on the system from the sources configured via
sources.list(5). New packages will be installed if required to
satisfy dependencies, but existing packages will never be removed.
If an upgrade for a package requires the remove of an installed
package the upgrade for this package isn't performed.
您运行
sudo apt update
以刷新可用包的列表。您运行
sudo apt upgrade
以升级所有已安装的软件包。显然,您总是在使用最新列表
update
之前运行。upgrade
该
... update
部分更新了可用软件包的库,以便您的系统知道可用的软件包,并可以将它们与已安装的软件包进行比较。从存储库中
... upgrade
获取包,并安装或“升级”包。据推测,如果有要升级的软件包,您只需要
... upgrade
,但是如果没有可升级的软件包,则apt
退出而不会出错。我认为手册页解释得很好:
因此,根据您的需要,您可能希望使用
update
或upgrade
两者都使用。请注意,升级软件包本身可能会带来一些困难。