apt和aptitude_如何使用Apt,Apt-Get,Aptitude命令列出可用的更新和可更新软件包?...

apt和aptitude

apt和aptitude

apt and apt-get provides online package update for the deb based distributions. We can list currently available updates of the current system with these apt and apt-get commands in different ways. We can list updateable or upgradeable packages for Linux distributions like Ubuntu, Debian, Mint, Kali etc.

aptapt-get为基于deb的发行版提供在线软件包更新。 我们可以使用这些apt和apt-get命令以不同的方式列出当前系统的当前可用更新。 我们可以列出Linux发行版的可更新或可升级软件包,例如Ubuntu,Debian,Mint,Kali等。

更新存储库/软件包信息 (Update Repository/Packages Information)

In order to list available package updates, we have to get the latest updates from package repositories. So first we will get latest updates one of the following commands.

为了列出可用的软件包更新,我们必须从软件包存储库中获取最新的更新。 因此,首先我们将获得以下命令之一的最新更新。

$ sudo apt update

OR

要么

$ sudo apt update
Update Repository/Packages Information
Update Repository/Packages Information
更新存储库/软件包信息

We can see in the last line of the screenshot that the total numbers of the available updates are provided which is 3 in this case.

我们可以在屏幕快照的最后一行看到提供的可用更新总数,在这种情况下为3。

列出带有apt的可用更新 (List Available Updates with apt)

Now we can list available updates with the apt command by providing list --upgradeable options.

现在,我们可以通过提供list --upgradeable选项,使用apt命令列出可用的更新。

$ apt list --upgradeable
List Available Updates with apt
List Available Updates with apt
列出带有apt的可用更新

We can see that the following information about the updateable packages is provided.

我们可以看到提供了有关可更新软件包的以下信息。

  • `name` of the package

    包的“名称”
  • `repository` of the package

    软件包的“存储库”
  • `newer version` of the package

    软件包的“较新版本”
  • `older or current version` of the package

    软件包的“旧版本”或“当前版本”

用apt-get列出可用更新 (List Available Updates with apt-get)

We can also use apt-get command with the specified options where it will provide less information according to apt command.

我们还可以将apt-get命令与指定选项一起使用,根据apt命令,它将提供较少的信息。

$ sudo apt-get -u upgrade --assume-no
List Available Updates with apt-get
List Available Updates with apt-get
用apt-get列出可用更新

We can see from the screenshot that only the updateable package names are provided.

从屏幕截图中我们可以看到,仅提供了可更新的软件包名称。

列出可用的可用更新 (List Available Updates with aptitude)

We can use  aptitude command in order to list upgradeable packages. We will use the search option where to select the upgrade flagged packages.

我们可以使用aptitude命令来列出可升级的软件包。 我们将使用search选项在其中选择升级标记的软件包。

$ aptitude search '~U'
List Available Updates with aptitude
List Available Updates with aptitude
列出可用的可用更新

使用apt,apt-get和aptitude安装/升级可用的软件包更新(Install/Upgrade Available Package Updates with apt, apt-get and aptitude)

We can update/upgrade available updates with apt , apt-get and aptitude commands like below.

我们可以使用aptapt-getaptitude命令更新/升级可用的更新,如下所示。

$ sudo apt dist-upgrade -y

OR

要么

$ sudo apt-get dist-upgrade -y

OR

要么

$ sudo aptitude safe-upgrade
Install/Upgrade Available Package Updates with apt, apt-get and aptitude
Install/Upgrade Available Package Updates with apt, apt-get and aptitude
使用apt,apt-get和aptitude安装/升级可用的软件包更新
LEARN MORE  Compare CentOS(RedHat) vs Ubuntu
了解更多信息比较CentOS(RedHat)vs Ubuntu

翻译自: https://www.poftut.com/how-to-list-available-updates-and-updateable-packages-with-apt-apt-get-aptitude-commands/

apt和aptitude

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值