Downgrade Ubuntu to previous version? [100% Working]

Written By - Omer Cakmak

Ubuntu releases receive a development codename ("Kinetic Kudu") and are organized by release year and month. For example, Ubuntu 22.10 was released in October 2022, and 21.04 (Hirsute Hippo) was released in April 2011.

LTS or "Long Term Support" versions are released every two years in April. LTS releases are "enterprise grade" versions of Ubuntu, with 95% of them being LTS releases.

A temporary version of Ubuntu is released every six months between LTS releases, and the latest example is 22.10. These are production quality releases and are supported for 9 months, providing enough time for users to update. These releases do not take the long-term commitment of LTS releases.

There are 3 different version commits in Ubuntu:

  • Hardware and maintenance updates
  • Interim release Standard Support
  • Extended Security Maintenance (ESM)

In this article, we will explain the steps to downgrade from Ubuntu 21.04 to 20.04 released with the Interim release Standard Support.


How to downgrade Ubuntu 21.04 to 20.04?


It is recommended to take backup of your existing data to avoid any unforeseen events. Please test the steps in lab environment before trying it out in production.

Sometimes the upgrade is done on purpose, sometimes the operating system is upgraded unconsciously. In this case, downgrade is required if there is no new LTS version.

As in version upgrade, root authorized user should be used in version downgrade or operations should be performed with sudo.

foc@foc-ubuntu21:~$ sudo su
[sudo] password for foc:

Current version information:

root@foc-ubuntu21:/home/foc# cat /etc/os-release
VERSION="21.04 (Hirsute Hippo)"
PRETTY_NAME="Ubuntu 21.04"

Current kernel information:

root@foc-ubuntu21:/home/foc# uname -a
Linux foc-ubuntu21 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Current repository information:

root@foc-ubuntu21:/# grep -wv "#" /etc/apt/sources.list

#deb cdrom:[Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420)]/ hirsute main restricted
deb hirsute main restricted
deb hirsute-updates main restricted
deb hirsute universe
deb hirsute-updates universe
deb hirsute multiverse
deb hirsute-updates multiverse
deb hirsute-backports main restricted universe multiverse
deb hirsute-security main restricted
deb hirsute-security universe
deb hirsute-security multiverse

If you cannot get updates with the current repository, edit the sources.list file with the following command:

root@foc-ubuntu21:/ sed -i -e 's/us.archive/old-releases/g' /etc/apt/sources.list

Then update the package list and get an upgrade:

root@foc-ubuntu21:/ apt update -y &&  apt upgrade -y

We are no longer dealing with the previous version. Actions after this step include downgrading.


Step-1: Backup the old sources.list file

Back up the old sources.list file with the following commands:

root@foc-ubuntu21:~# cd /etc/apt/
root@foc-ubuntu21:/etc/apt# mv sources.list sources.list-old


Step-2: Add Ubuntu 20.04 LTS (Focal Fossa) repository

Now add the official Ubuntu 20.04 LTS (Focal Fossa) repository information:

root@foc-ubuntu21:/etc/apt# nano sources.list

deb focal main restricted
#deb-src focal main restricted
deb focal-updates main restricted
#deb-src focal-updates main restricted
deb focal universe
#deb-src focal universe
deb focal-updates universe
#deb-src focal-updates universe
deb focal multiverse
#deb-src focal multiverse
deb focal-updates multiverse
#deb-src focal-updates multiverse
deb focal-backports main restricted universe multiverse
#deb-src focal-backports main restricted universe multiverse
deb focal-security main restricted
#deb-src focal-security main restricted
deb focal-security universe
#deb-src focal-security universe
deb focal-security multiverse
#deb-src focal-security multiverse



Step-3: Create preferences file

The part files /etc/apt/preferences.d/ in the APT preferences file can be used to control which package versions are selected for installation.
APT assigns a priority to each available version, and subject to dependency restrictions, apt-get selects the version with the highest priority for installation.
APT preferences override the priorities that APT assigns to package versions by default, thus giving the user control over which one is selected for installation.

Create a file for focal under the /etc/apt/preferences.d directory and write the following information:

root@foc-ubuntu21:/etc/apt# nano /etc/apt/preferences.d/focal

Package: *
Pin: release n=focal
Pin-Priority: 1001

Package: *
Pin: release n=focal-updates
Pin-Priority: 1002

Package: *
Pin: release n=focal-security
Pin-Priority: 1003


Step-4: Start Downgrade

Now we start downgrading with the new repository:

root@foc-ubuntu21:/etc/apt# apt update -y

Install the aptitude package for downgrade:

root@foc-ubuntu21:/etc/apt# apt install aptitude -y

Then start the downgrade:

root@foc-ubuntu21:/etc/apt# aptitude dist-upgrade -y

During the downgrade, the downgrade process may be interrupted:

Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.2+dfsg-1build1) ...
Errors were encountered while processing:

Current status: 8 (+8) broken, 47 (-2) upgradable.

In this case, the downgrade process is repeated:

root@foc-ubuntu21:/etc/apt# aptitude dist-upgrade -y

Fix bad packages in package downgrade with the following command:

root@foc-ubuntu21:/etc/apt# apt --fix-broken install

Depending on the packages installed on Ubuntu 21.04 and their dependencies, you may receive errors in the installation. Here is an example error and its solution:

dpkg: error processing archive /var/cache/apt/archives/libgamemode0_1.5.
1-0ubuntu3.1_amd64.deb (--unpack):
trying to overwrite '/usr/libexec/cpugovctl', which is also in package
gamemode-daemon 1.6.1-1


root@foc-ubuntu21:/etc/apt# dpkg -i --force-overwrite /var/cache/apt/archives/libgamemode0_1.5.1-0ubuntu3.1_amd64.deb

Then the downgrade process is repeated:

root@foc-ubuntu21:/etc/apt# aptitude dist-upgrade -y

The downgrade continues until you see the following message:

No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

Downgrade completed successfully, release version:

root@foc-ubuntu21:/etc/apt# cat /etc/os-release
VERSION="20.04.5 LTS (Focal Fossa)"
PRETTY_NAME="Ubuntu 20.04.5 LTS"

The operating system became Ubuntu 20.04.5 LTS (Focal Fossa).


Step-5: Delete unnecessary packages

Finally after installation the unused packages are deleted:

root@foc-ubuntu21:/etc/apt# apt autoremove -y



Upgrade is a difficult process, but downgrade is more difficult. If you want to downgrade your Ubuntu 21.04 operating system to 20.04, this article will do the trick. But you should know that you will encounter errors and problems.


Reinstallation is recommended if possible.


References - How to roll back Ubuntu to a previous version? - dpkg: error processing


Didn't find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

4 thoughts on “Downgrade Ubuntu to previous version? [100% Working]”

  1. This is doe af, I lost a few stuff though but it was great. And I had a mini scare when I lost my Ubuntu desktop while downgrading… but you just need to continue the downgrade and reinstall the Ubuntu desktop when you have finished the downgrade. PS have this article opened somewhere els

  2. I used this for 22 to 20. Worked like a charm. Also had a few panic moments when booting again was a bit longer then expected.

    10/10 would attempt to brick a server again.

  3. how do you install Ubuntu desktop?
    I can’t get the ip or internet connection after downgrade.
    ifconfig only shows the “lo” entry.


Leave a Comment