列出Ubuntu上可用的软件包更新
时间:2020-01-09 10:42:31 来源:igfitidea点击:
列出可升级的软件包
Ubuntu中的可升级软件包是具有源存储库中可用更新的软件包。我们可以通过运行apt upgrade命令来确定哪些软件包具有可用的补丁程序。
sudo apt upgrade
当然,通过使用此方法,我们将期望通过输出末尾的提示来安装更新。
Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following NEW packages will be installed: amd64-microcode intel-microcode iucode-tool libuv1 linux-headers-4.15.0-48 linux-headers-4.15.0-48-generic linux-image-4.15.0-48-generic linux-modules-4.15.0-48-generic linux-modules-extra-4.15.0-48-generic python3-netifaces The following packages will be upgraded: apport apt apt-utils base-files bsdutils cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf command-not-found command-not-found-data console-setup console-setup-linux cryptsetup cryptsetup-bin dpkg e2fsprogs ebtables fdisk friendly-recovery gcc-8-base grub-common grub-pc grub-pc-bin grub2-common initramfs-tools initramfs-tools-bin initramfs-tools-core irqbalance keyboard-configuration kmod landscape-common language-selector-common libapt-inst2.0 libapt-pkg5.0 libblkid1 libcom-err2 libcryptsetup12 libdrm-common libdrm2 libext2fs2 libfdisk1 libgcc1 libglib2.0-0 ubuntu-server ubuntu-standard udev ufw uidmap unattended-upgrades update-manager-core update-notifier-common ureadahead util-linux uuid-runtime wireless-regdb 149 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Need to get 194 MB of archives. After this operation, 386 MB of additional disk space will be used. Do you want to continue? [Y/n]
尽管有信息,但有时所需的只是格式良好的软件包列表,其中包含可用的更新。 Apt提供的命令使我们能够生成软件包更新的简单列表。
Apt提供了一个名为list的命令,该命令生成软件包列表。可以使用标志(例如已安装和可升级)来过滤列表。我们将使用可升级标志来生成仅软件包列表,这些软件包具有来自其源存储库的更新。
sudo apt list --upgradable
输出将提供有关可用于安装的软件包更新的有价值的信息。该信息将包括更新的版本号,目标体系结构以及我们要从中升级的版本。
以下是命令输出的示例。
Listing... Done apport/bionic-updates 2.20.9-0ubuntu7.6 all [upgradable from: 2.20.9-0ubuntu7] apt/bionic-updates 1.6.10 amd64 [upgradable from: 1.6.1] apt-utils/bionic-updates 1.6.10 amd64 [upgradable from: 1.6.1] base-files/bionic-updates 10.1ubuntu2.4 amd64 [upgradable from: 10.1ubuntu2] bsdutils/bionic-updates 1:2.31.1-0.4ubuntu3.3 amd64 [upgradable from: 1:2.31.1-0.4ubuntu3] cloud-init/bionic-updates 18.5-45-g3554ffe8-0ubuntu1~18.04.1 all [upgradable from: 18.2-14-g6d48d265-0ubuntu1] cloud-initramfs-copymods/bionic-updates 0.40ubuntu1.1 all [upgradable from: 0.40ubuntu1] cloud-initramfs-dyn-netconf/bionic-updates 0.40ubuntu1.1 all [upgradable from: 0.40ubuntu1] command-not-found/bionic-updates 18.04.5 all [upgradable from: 18.04.4] command-not-found-data/bionic-updates 18.04.5 amd64 [upgradable from: 18.04.4] console-setup/bionic-updates 1.178ubuntu2.9 all [upgradable from: 1.178ubuntu2] console-setup-linux/bionic-updates 1.178ubuntu2.9 all [upgradable from: 1.178ubuntu2] cryptsetup/bionic-updates 2:2.0.2-1ubuntu1.1 amd64 [upgradable from: 2:2.0.2-1ubuntu1] cryptsetup-bin/bionic-updates 2:2.0.2-1ubuntu1.1 amd64 [upgradable from: 2:2.0.2-1ubuntu1] dpkg/bionic-updates 1.19.0.5ubuntu2.1 amd64 [upgradable from: 1.19.0.5ubuntu2] e2fsprogs/bionic-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1] ebtables/bionic-updates 2.0.10.4-3.5ubuntu2.18.04.3 amd64 [upgradable from: 2.0.10.4-3.5ubuntu2] fdisk/bionic-updates 2.31.1-0.4ubuntu3.3 amd64 [upgradable from: 2.31.1-0.4ubuntu3] friendly-recovery/bionic-updates 0.2.38ubuntu1 all [upgradable from: 0.2.38] gcc-8-base/bionic-updates 8.3.0-6ubuntu1~18.04 amd64 [upgradable from: 8-20180414-1ubuntu2] libcryptsetup12/bionic-updates 2:2.0.2-1ubuntu1.1 amd64 [upgradable from: 2:2.0.2-1ubuntu1] libdrm-common/bionic-updates 2.4.95-1~18.04.1 all [upgradable from: 2.4.91-2] libdrm2/bionic-updates 2.4.95-1~18.04.1 amd64 [upgradable from: 2.4.91-2] libext2fs2/bionic-updates 1.44.1-1ubuntu1.1 amd64 [upgradable from: 1.44.1-1] libfdisk1/bionic-updates 2.31.1-0.4ubuntu3.3 amd64 [upgradable from: 2.31.1-0.4ubuntu3] libgcc1/bionic-updates 1:8.3.0-6ubuntu1~18.04 amd64 [upgradable from: 1:8-20180414-1ubuntu2] libglib2.0-0/bionic-updates 2.56.4-0ubuntu0.18.04.2 amd64 [upgradable from: 2.56.1-2ubuntu1] libglib2.0-data/bionic-updates 2.56.4-0ubuntu0.18.04.2 all [upgradable from: 2.56.1-2ubuntu1]