Skip to content

Upgrading Packages#

Now that we have a big list of things to upgrade, let's do just that: sudo apt upgrade

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
superman@develop:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  distro-info libatasmart4 libblockdev-crypto2 libblockdev-fs2 libblockdev-loop2 libblockdev-part-err2 libblockdev-part2
  libblockdev-swap2 libblockdev-utils2 libblockdev2 libfwupdplugin5 libjcat1 libmbim-glib4 libmbim-proxy libmm-glib0 libnspr4 libnss3
  libparted-fs-resize0 libqmi-glib5 libqmi-proxy libudisks2-0 libvolume-key1 modemmanager motd-news-config python3-pexpect
  python3-ptyprocess udisks2 usb-modeswitch usb-modeswitch-data
The following packages will be upgraded:
  alsa-ucm-conf apt apt-utils base-files bcache-tools bolt cloud-init cloud-initramfs-copymods cloud-initramfs-dyn-netconf
  command-not-found dirmngr finalrd friendly-recovery fwupd fwupd-signed gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client
  gpg-wks-server gpgconf gpgsm gpgv initramfs-tools initramfs-tools-bin initramfs-tools-core landscape-common language-selector-common
  libapt-pkg6.0 libasound2 libasound2-data libdns-export1109 libefiboot1 libefivar1 libfwupd2 libfwupdplugin1 libglib2.0-0 libglib2.0-bin
  libglib2.0-data libisc-export1105 libldap-2.4-2 libldap-common liblzma5 libnetplan0 libpam-modules libpam-modules-bin libpam-runtime
  libpam0g libparted2 libpci3 libplymouth5 libprocps8 libxmlb1 linux-base login lshw lsof mdadm netplan.io networkd-dispatcher open-iscsi
  open-vm-tools overlayroot parted passwd pciutils plymouth plymouth-theme-ubuntu-text pollinate procps python-apt-common python3-apt
  python3-commandnotfound python3-distupgrade python3-software-properties python3-twisted python3-twisted-bin python3-update-manager
  rsync rsyslog software-properties-common sosreport tmux ubuntu-advantage-tools ubuntu-keyring ubuntu-minimal
  ubuntu-release-upgrader-core ubuntu-server ubuntu-standard ufw unattended-upgrades update-manager-core update-notifier-common wget
  xz-utils zlib1g
98 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.5 MB of archives.
After this operation, 24.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]

So, we can see we're getting out original 98 upgraded, but we're also getting 29 newly installed packages too. That's because inside of those 98 packages will be some software that has new dependencies - other pieces of software that it depends on. For us to upgrade what we currently have installed to the latest version, we need to install those new packages too, because the newer versions of the existing packages need them.

This whole upgrade is going to download 25.5 MB of archives. After it's downloaded them, the installation of those packages is going to use 24.5 MB of space.

And finally we're being asked if we want to continue: Do you want to continue? [Y/n]. You can either just press Enter and except the default answer, which is Y for Yes, or you can type N (for no) and press Enter to reject the changes.

Note

Whenever you're presented with prompt like this, it's generally accepted as standard practice for whatever letter is capitalised to be the default answer if you just press Enter in response to the prompt.

That being said, do pay attention to the prompt and make sure you're doing the right thing.

If we press Enter or type Y and press Enter, we'll install the packages. Let's actually type N, Enter and try something else. We are going to accept the changes to the system, but we're going to accept them in another way you'll find very useful over the course of your career.

Type this: sudo apt upgrade -y

Your screen will explode with activity, a lot of it, all scrolling past you in the terminal. Give it time to finish and we'll analyse the results.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
superman@develop:~$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  ...
The following packages will be upgraded:
  ...
98 upgraded, 29 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.5 MB of archives.
After this operation, 24.5 MB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com/ubuntu focal-updates/main amd64 ubuntu-server amd64 1.450.2 [2,680 B]
Get:2 http://au.archive.ubuntu.com/ubuntu focal-updates/main amd64 base-files amd64 11ubuntu5.5 [60.5 kB]
Get:3 http://au.archive.ubuntu.com/ubuntu focal-updates/main amd64 motd-news-config all 11ubuntu5.5 [4,472 B]
...
Installing new version of config file /etc/vmware-tools/tools.conf.example ...
Installing new version of config file /etc/vmware-tools/vgauth.conf ...
Removing obsolete conffile /etc/vmware-tools/vm-support ...
Setting up procps (2:3.3.16-1ubuntu2.3) ...
Setting up language-selector-common (0.204.2) ...
Setting up ubuntu-advantage-tools (27.6~20.04.1) ...
Installing new version of config file /etc/logrotate.d/ubuntu-advantage-tools ...
Installing new version of config file /etc/ubuntu-advantage/uaclient.conf ...
Created symlink /etc/systemd/system/multi-user.target.wants/ua-reboot-cmds.service → /lib/systemd/system/ua-reboot-cmds.service.
...

I've massively reduced this output down because mine was 157 lines. Yours might even be longer.

Now you can tell me what the -y flag did to change the behaviour of the apt upgrade command? It automatically answered the prompt for us and in fact, it prevented the command from even asking us. This can be useful, but also dangerous. Make sure you know what you're doing (and what you're installing.)

We've now updated all of those packages. Although you might not need to, it can be a good idea to reboot a system after such a large update to ensure newer versions of software, libraries, and more, and being loaded into memory and used. Older versions might have security issues.