Categories
SysOps

How to install Ubuntu Release Upgrader on an older system

Install Ubuntu Release Upgrader on an older system.

Connect to an older Ubuntu instance.

$ ssh example.org -l mgmt
Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0 x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
Last login: Wed Apr 27 16:25:14 2022 from 137.11.134.19

Inspect operating system details.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.4 LTS
Release:	20.04
Codename:	focal

Try to check if a new distribution release is available to determine that the Ubuntu Release Upgrader is not installed.

$ do-release-upgrade --check-dist-upgrade-only --devel-release
-bash: do-release-upgrade: command not found

Install ubuntu-release-upgrader-core package.

$ sudo apt install ubuntu-release-upgrader-core
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  iso-codes python-apt-common python3-apt python3-distro-info python3-distupgrade python3-update-manager
Suggested packages:
  isoquery python3-apt-dbg python-apt-doc python3-launchpadlib
The following NEW packages will be installed:
  iso-codes python-apt-common python3-apt python3-distro-info python3-distupgrade python3-update-manager ubuntu-release-upgrader-core
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3038 kB of archives.
After this operation, 22.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 iso-codes all 4.4-1 [2695 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 python-apt-common all 2.0.0ubuntu0.20.04.7 [17.1 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-apt amd64 2.0.0ubuntu0.20.04.7 [154 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 python3-distro-info all 0.23ubuntu1 [5924 B]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-update-manager all 1:20.04.10.10 [38.1 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-distupgrade all 1:20.04.38 [104 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 ubuntu-release-upgrader-core all 1:20.04.38 [24.3 kB]
Fetched 3038 kB in 1s (2704 kB/s)                  
Selecting previously unselected package iso-codes.
(Reading database ... 27217 files and directories currently installed.)
Preparing to unpack .../0-iso-codes_4.4-1_all.deb ...
Unpacking iso-codes (4.4-1) ...
Selecting previously unselected package python-apt-common.
Preparing to unpack .../1-python-apt-common_2.0.0ubuntu0.20.04.7_all.deb ...
Unpacking python-apt-common (2.0.0ubuntu0.20.04.7) ...
Selecting previously unselected package python3-apt.
Preparing to unpack .../2-python3-apt_2.0.0ubuntu0.20.04.7_amd64.deb ...
Unpacking python3-apt (2.0.0ubuntu0.20.04.7) ...
Selecting previously unselected package python3-distro-info.
Preparing to unpack .../3-python3-distro-info_0.23ubuntu1_all.deb ...
Unpacking python3-distro-info (0.23ubuntu1) ...
Selecting previously unselected package python3-update-manager.
Preparing to unpack .../4-python3-update-manager_1%3a20.04.10.10_all.deb ...
Unpacking python3-update-manager (1:20.04.10.10) ...
Selecting previously unselected package python3-distupgrade.
Preparing to unpack .../5-python3-distupgrade_1%3a20.04.38_all.deb ...
Unpacking python3-distupgrade (1:20.04.38) ...
Selecting previously unselected package ubuntu-release-upgrader-core.
Preparing to unpack .../6-ubuntu-release-upgrader-core_1%3a20.04.38_all.deb ...
Unpacking ubuntu-release-upgrader-core (1:20.04.38) ...
Setting up python-apt-common (2.0.0ubuntu0.20.04.7) ...
Setting up python3-distro-info (0.23ubuntu1) ...
Setting up iso-codes (4.4-1) ...
Setting up python3-apt (2.0.0ubuntu0.20.04.7) ...
Setting up python3-update-manager (1:20.04.10.10) ...
Setting up python3-distupgrade (1:20.04.38) ...
Setting up ubuntu-release-upgrader-core (1:20.04.38) ...
Processing triggers for man-db (2.9.1-1) ...

Inspect available releases.

$ do-release-upgrade --check-dist-upgrade-only --devel-release
Checking for a new Ubuntu release
New release '22.04' available.
Run 'do-release-upgrade' to upgrade to it.
$ do-release-upgrade --check-dist-upgrade-only
Checking for a new Ubuntu release
New release '21.10' available.
Run 'do-release-upgrade' to upgrade to it.

Start release upgrade.

$ sudo do-release-upgrade --devel-release

Additional notes

The Ubuntu Release Upgrader requires the Python 3 interface to D-Bus which can be missing in this case.

ModuleNotFoundError: No module named 'dbus'

Install python3-dbus package and retry operation.

$ sudo apt-get install python3-dbus