
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.
apt
和apt-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

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

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

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'

使用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.
我们可以使用apt
, apt-get
和aptitude
命令更新/升级可用的更新,如下所示。
$ sudo apt dist-upgrade -y
OR
要么
$ sudo apt-get dist-upgrade -y
OR
要么
$ sudo aptitude safe-upgrade

apt和aptitude