如何更新Ubuntu 20.04 LTS

如果您希望将Ubuntu 18.04 LTS系统升级到Ubuntu 20.04 LTS,请访问逐步指南,从Ubuntu 18.04 LTS升级到Ubuntu 20.04 LTS。

尽管Ubuntu 20.04是最近发布的,但由于Canonical经常发布其操作系统的更新,因此应该有一些更新在等待您的系统。

在大多数情况下,在安装Ubuntu之后,您将看到等待安装的更新。

读: 如何安装Ubuntu 20.04 LTS(BIOS / UEFI)

读: 如何与Windows 10一起安装Ubuntu 20.04 LTS

本指南可帮助您如何更新Ubuntu系统以具有更新的OS和应用程序包,以确保系统安全。

后备

在执行更新之前,请考虑对重要文件进行备份以使用Timeshift来保护位置。

更新Ubuntu 20.04

您可以使用图形模式或命令行模式更新Ubuntu。

图形模式

此模式适用于Ubuntu新手。

打开 软件更新器活动项目


打开软件更新程序

现在,软件更新程序将获取可用更新的详细信息。

查询更新
查询更新

单击立即安装以开始安装更新。

安装更新
安装更新

等待一段时间以完成更新。 更新时间取决于互联网速度和系统配置。

在安装更新
在安装更新

单击立即重启以重新引导系统。

重启系统
重启系统

重新启动后,再次检查更新以查看是否有任何更新仍在等待安装。

系统最新
系统最新

命令行

更新存储库索引。

sudo apt update

首先,让我们看看您的系统有哪些可用的更新。

sudo apt list --upgradable

输出:

The following updates are available for my system.

Listing... Done
apt-utils/focal-updates,focal-security 2.0.2ubuntu0.1 amd64 [upgradable from: 2.0.2]
apt/focal-updates,focal-security 2.0.2ubuntu0.1 amd64 [upgradable from: 2.0.2]
cups-bsd/focal-updates,focal-security 2.3.1-9ubuntu1.1 amd64 [upgradable from: 2.3.1-9ubuntu1]
cups-client/focal-updates,focal-security 2.3.1-9ubuntu1.1 amd64 [upgradable from: 2.3.1-9ubuntu1]
cups-common/focal-updates,focal-updates,focal-security,focal-security 2.3.1-9ubuntu1.1 all [upgradable from: 2.3.1-9ubuntu1]
cups-core-drivers/focal-updates,focal-security 2.3.1-9ubuntu1.1 amd64 [upgradable from: 2.3.1-9ubuntu1]
cups-daemon/focal-updates,focal-security 2.3.1-9ubuntu1.1 amd64 [upgradable from: 2.3.1-9ubuntu1]
cups-ipp-utils/focal-updates,focal-security 2.3.1-9ubuntu1.1 amd64 [upgradable from: 2.3.1-9ubuntu1]

.     .     .
.     .     .

thermald/focal-updates 1.9.1-1ubuntu0.1 amd64 [upgradable from: 1.9.1-1build1]
ubuntu-drivers-common/focal-updates 1:0.8.1.1 amd64 [upgradable from: 1:0.8.1]
ubuntu-release-upgrader-core/focal-updates,focal-updates 1:20.04.19 all [upgradable from: 1:20.04.18]
ubuntu-release-upgrader-gtk/focal-updates,focal-updates 1:20.04.19 all [upgradable from: 1:20.04.18]
uno-libs-private/focal-updates 1:6.4.3-0ubuntu0.20.04.1 amd64 [upgradable from: 1:6.4.2-0ubuntu3]
update-manager-core/focal-updates,focal-updates 1:20.04.10 all [upgradable from: 1:20.04.9]
update-manager/focal-updates,focal-updates 1:20.04.10 all [upgradable from: 1:20.04.9]
ure/focal-updates 1:6.4.3-0ubuntu0.20.04.1 amd64 [upgradable from: 1:6.4.2-0ubuntu3]

如果您对更新感到满意,请继续在系统上安装更新。

现在,为内核和已安装的应用程序安装更新。

sudo apt upgrade

您将获得将要升级的软件包的列表。 您需要输入 ÿ 然后按 输入 开始更新。

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  distro-info-data eog file-roller fonts-opensymbol gedit gedit-common gir1.2-gnomedesktop-3.0 glib-networking
  glib-networking-common glib-networking-services gnome-control-center gnome-control-center-data
  gnome-control-center-faces gnome-desktop3-data gnome-initial-setup gnome-shell gnome-shell-common
  libgnome-desktop-3-19 libjuh-java libjurt-java libnautilus-extension1a libnetplan0 libreoffice-base-core
  libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3
  libreoffice-help-common libreoffice-help-en-us libreoffice-impress libreoffice-math libreoffice-ogltrans
  libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-colibre libreoffice-style-elementary
  libreoffice-style-tango libreoffice-writer libridl-java libuno-cppu3 libuno-cppuhelpergcc3-3
  libuno-purpenvhelpergcc3-3 libuno-sal3 libuno-salhelpergcc3-3 libunoloader-java nautilus nautilus-data netplan.io
  python3-distupgrade python3-uno python3-update-manager strace thermald ubuntu-drivers-common
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk uno-libs-private update-manager update-manager-core ure
62 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 104 MB of archives.
After this operation, 201 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y  

.     .     .
.     .     .

Get:11 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 ubuntu-drivers-common amd64 1:0.8.1.1 [44.6 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 distro-info-data all 0.43ubuntu1.1 [4,584 B]
Get:13 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libnetplan0 amd64 0.99-0ubuntu3~20.04.1 [23.0 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 netplan.io amd64 0.99-0ubuntu3~20.04.1 [70.9 kB]

下载软件包更新后,安装程序将自动开始安装它。

Unpacking gnome-control-center-data (1:3.36.2-0ubuntu1) over (1:3.36.1-1ubuntu5) ...
Preparing to unpack .../28-gnome-control-center_1%3a3.36.2-0ubuntu1_amd64.deb ...
Unpacking gnome-control-center (1:3.36.2-0ubuntu1) over (1:3.36.1-1ubuntu5) ...
Preparing to unpack .../29-gnome-control-center-faces_1%3a3.36.2-0ubuntu1_all.deb ...
Unpacking gnome-control-center-faces (1:3.36.2-0ubuntu1) over (1:3.36.1-1ubuntu5) ...
Preparing to unpack .../30-gnome-initial-setup_3.36.2-0ubuntu1_amd64.deb ...
Unpacking gnome-initial-setup (3.36.2-0ubuntu1) over (3.36.1-1ubuntu1) ...

等待一段时间以完成系统更新。 更新时间取决于互联网速度和系统配置。

Setting up gnome-initial-setup (3.36.2-0ubuntu1) ...
Setting up nautilus (1:3.36.2-0ubuntu1) ...
Processing triggers for fontconfig (2.13.1-2ubuntu3) ...
Setting up gnome-control-center (1:3.36.2-0ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu2) ...
Setting up gedit (3.36.2-0ubuntu1) ...
Setting up update-manager (1:20.04.10) ...

安装软件包后,重新启动系统。

sudo reboot

使用apt命令查看是否有任何更新等待安装。

sudo apt list --upgradable

输出:

Listing... Done

要么

sudo apt update

输出:(最后一行)

All packages are up to date.

结论

就这样。 我希望到目前为止,您在Ubuntu 20.04系统上拥有最新更新。 请在评论部分分享您的反馈。

Sidebar