如何通过终端更新单个应用程序

如何通过终端更新单个应用程序

我想单独更新 Firefox,而不更新所有应用程序。我想通过终端进行更新。可以吗?因为我的网络连接很慢。

我正在使用带有 GNOME 桌面环境的 Ubuntu 15.04。

答案1

如果仅单独升级 Firefox,请执行以下操作:

sudo apt-get dist-upgrade firefox

或者

sudo apt-get upgrade firefox

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 important ones if necessary. The dist-upgrade command may
    therefore 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.

答案2

要检查 Firefox 包是否可以升级,请运行以下命令:

apt list --upgradable | grep ^firefox

要仅从终端类型升级 Firefox,请输入:

sudo apt upgrade firefox  

上述命令无需选项即可运行--only-upgrade。如果您的 Firefox 已经是最新版本,则该命令将不会安装任何新软件包,您将收到以下消息:

firefox is already the newest version.

答案3

sudo apt-get install firefox

这只会升级firefox到最新版本。

有关详细信息,请使用man apt-get并转到安装部分:

安装

如果您想要升级一个或多个已安装的软件包,而不升级系统上的所有软件包,也可以使用此目标。
与安装所有当前安装的软件包的最新版本的“升级”目标不同,“安装”将仅安装指定软件包的最新版本。
只需提供要升级的软件包的名称,如果有较新的版本可用,它将下载并安装它(及其依赖项,如上所述)。

答案4

你可以更新一个应用通过使用命令行使用以下命令:

$ sudo apt upgrade <app name>

如果没有更新在里面系统的存储库,请按照以下步骤操作:

您可以安装 Snap 包管理器来安装新的应用程序版本。

要安装它,请按照以下命令:

$ sudo apt install snapd

然后你可以安装 应用程序通过以下命令:

$ sudo snap install <app name>

注意:并非所有应用程序展示在里面。

应用程序始终是最新版本

折断 地点在这些网址:

https://snapcraft.io/store

并询问关于 Snap 的命令,使用命令:

$ man snap

相关内容