How to Downgrade Ubuntu 21.04 to 20.04 LTS?

Downgrade Ubuntu 21.04 (Hirsute Hippo) to 20.04 LTS (Focal Fossa) with apt pinning, sources.list retargeting, and aptitude dist-upgrade—no data loss under /home when the run completes, plus dpkg recovery, reboot checks, and GRUB fixes when packages break mid-hop.

Published

Updated

Read time 8 min read

Reviewed byDeepak Prasad

Downgrade Ubuntu 21.04 Hirsute to 20.04 Focal with apt pinning and sources.list

Canonical does not provide do-release-downgrade. If you are on Ubuntu 21.04 (Hirsute Hippo) and want Ubuntu 20.04 LTS (Focal Fossa) back, the supported answer is restore a backup or reinstall—not reverse the release in place.

The unsupported path retargets /etc/apt/sources.list to focal, adds an apt preferences pin file so older packages win over what is installed, and runs aptitude dist-upgrade. The walkthrough below follows that order on a lab host named foc-ubuntu21. Files under /home were still there when the downgrade finished; plan for broken desktop packages, repeat aptitude runs, and a reboot before you call the system healthy.

Tested on: Ubuntu 21.04 (Hirsute Hippo) at start; finished on Ubuntu 20.04.5 LTS (Focal); kernel 5.11.0-49-generic during the downgrade run.

WARNING
Take a hypervisor snapshot or filesystem backup before you edit apt sources. If gdm3, GRUB, or libc6 configuration fails mid-hop, restore the backup instead of pushing through on a hybrid system. See backup and rollback options.

Quick command summary

Task Command
Confirm release cat /etc/os-release
Back up sources sudo cp /etc/apt/sources.list ~/sources.list.backup
EOL hirsute mirror `sudo sed -i 's
Focal pin file /etc/apt/preferences.d/focal → suites focal* at priorities 1001–1003
Retarget sources Edit sources.list for focal or sudo sed -i 's/hirsute/focal/g' /etc/apt/sources.list
Downgrade sudo aptitude dist-upgrade -y
Fix dpkg sudo DEBIAN_FRONTEND=noninteractive dpkg --force-confdef --force-confold --configure -a
Force release flip sudo apt-get install -y --allow-downgrades libc6 base-files ubuntu-minimal
Reboot sudo reboot then uname -r
Fix GRUB sudo apt install --reinstall grub-common grub2-common grub-pc-bin
Clean up apt list '?obsolete' then sudo apt autoremove --purge

Downgrade path at a glance

Phase What happens
Prepare on 21.04 Point hirsute mirrors at old-releases if needed; patch packages
Back up and retarget Save sources.list; switch suites to focal; add pin file
Downgrade aptitude dist-upgrade (repeat until quiescent)
Recover dpkg --configure -a, --force-overwrite, or focal libc6/base-files if stuck
Reboot Load focal kernel; fix GRUB if scripts are missing
Verify os-release, dpkg --audit, obsolete package list

Prerequisites

  • Ubuntu 21.04 with sudo or root on a console that will not drop during a long aptitude run.
  • Working network access to Ubuntu mirrors—today both hirsute and focal often live on old-releases.ubuntu.com.
  • aptitude (install during the downgrade if missing).
  • A rollback plan—hypervisor snapshot, LVM snapshot, or fsarchiver archive (see next section).

Backup and rollback options

apt pinning rewrites system packages; it does not delete /home, but a failed boot loader or C library can lock you out. Pick at least one rollback path before you change sources.list:

Method Best for Guide
Hypervisor snapshot VirtualBox, VMware, Proxmox guests Snapshot before editing apt sources

If partition layout might change, save the partition table with backup and restore the partition table in Linux.


Pre-downgrade checks

Run these before you retarget apt. They give you a baseline for version, kernel, disk space, and broken packages.

Check mount-point usage and filesystem types with df; the df and du covers -h, -T, and filtering pseudo-filesystems.

Use cat /etc/os-release to confirm the target release before editing apt sources; see check Ubuntu version for other version checks.

bash
cat /etc/os-release
uname -r
df -h /
dpkg --audit
sudo cp /etc/apt/sources.list ~/sources.list.backup

Example starting point from the lab host:

text
PRETTY_NAME="Ubuntu 21.04"
VERSION_CODENAME=hirsute
Linux foc-ubuntu21 5.11.0-49-generic ...

Point hirsute at old-releases (if apt update fails)

Ubuntu 21.04 is end of life. If apt update cannot reach hirsute on the default archive, switch mirrors first and fully patch the current release:

bash
sudo sed -i 's|//[^/]*archive.ubuntu.com|//old-releases.ubuntu.com|g' /etc/apt/sources.list
sudo sed -i 's|//security.ubuntu.com/ubuntu|//old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
sudo apt update -y
sudo apt upgrade -y

After this step you are still on 21.04 packages—the downgrade starts when you retarget sources.list to focal.


Step 1 — Back up sources.list

Move the live file aside so you can restore it if the pin or suite edit goes wrong:

bash
sudo mv /etc/apt/sources.list /etc/apt/sources.list-old

Step 2 — Retarget apt to Ubuntu 20.04 LTS (focal)

Create a new /etc/apt/sources.list with focal, focal-updates, focal-security, and focal-backports stanzas. You can paste the full file in an editor:

bash
sudo nano /etc/apt/sources.list

Example focal entries (adjust mirror country if you prefer):

text
deb http://old-releases.ubuntu.com/ubuntu focal main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu focal-security main restricted universe multiverse

If your file still uses hirsute codenames everywhere, a one-line swap works the same way:

bash
sudo sed -i 's/hirsute/focal/g' /etc/apt/sources.list

Use old-releases.ubuntu.com for focal if the default archive no longer carries those suites.


Step 3 — Create the focal apt pin file

Files under /etc/apt/preferences.d/ override default apt priorities. Pin focal suites above what is installed so aptitude can downgrade thousands of packages. See the APT preferences manual and apt command in Linux for how priorities interact with apt install specific version pinning.

Create /etc/apt/preferences.d/focal:

text
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 — Run aptitude dist-upgrade

Refresh the index, install aptitude if needed, then start the downgrade:

bash
sudo apt update -y
sudo apt install -y aptitude
sudo DEBIAN_FRONTEND=noninteractive aptitude dist-upgrade -y

aptitude resolves conflicts differently than apt dist-upgrade and often survives release downgrades when apt’s AutoRemover errors out.

When aptitude stops with broken packages

A desktop downgrade commonly halts with a long “Errors were encountered while processing” list—cups, gdm3, gnome-shell, and related packages on the lab host:

text
Errors were encountered while processing:
cups-ipp-utils
systemd-sysv
gdm3
gnome-shell
...
Current status: 8 (+8) broken, 47 (-2) upgradable.

Repeat the downgrade after each recovery step:

bash
sudo DEBIAN_FRONTEND=noninteractive aptitude dist-upgrade -y

Finish configuring half-installed packages without interactive config prompts:

bash
sudo DEBIAN_FRONTEND=noninteractive dpkg --force-confdef --force-confold --configure -a
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades -f \
  -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"

If apt --fix-broken install alone does not clear the queue, prefer the dpkg --configure -a path first when display manager postinst scripts block the terminal.

File overwrite conflicts

When two packages claim the same path, force the focal .deb from cache (adjust the filename to match your error):

text
dpkg: error processing archive .../libgamemode0_1.5.1-0ubuntu3.1_amd64.deb (--unpack):
trying to overwrite '/usr/libexec/cpugovctl', which is also in package gamemode-daemon
bash
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libgamemode0_1.5.1-0ubuntu3.1_amd64.deb
sudo DEBIAN_FRONTEND=noninteractive aptitude dist-upgrade -y

If /etc/os-release still shows 21.04

When aptitude reports nothing left to change but PRETTY_NAME is still Hirsute, install focal core packages explicitly:

bash
apt-cache policy libc6 base-files ubuntu-minimal
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-downgrades \
  -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
  libc6 base-files ubuntu-minimal

apt picks focal candidates when the pin file is in place; use =<version> from apt-cache policy only if apt refuses unpinned installs.

Downgrade complete

Continue until aptitude prints a quiescent summary:

text
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Then confirm the release file:

bash
cat /etc/os-release
text
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_CODENAME=focal

Reboot after the downgrade

Kernel and initramfs updates set /var/run/reboot-required. Reboot so you run a focal kernel that matches the downgraded packages:

bash
cat /var/run/reboot-required || echo "OK — no reboot pending"
sudo reboot
uname -r
ls /boot/vmlinuz-*

If the system boots an old hirsute kernel while packages are already focal, set GRUB_DEFAULT to a focal vmlinuz entry or remove obsolete hirsute linux-image-* packages after you confirm a focal kernel is installed.

GRUB scripts missing

If update-grub fails with grub-mkconfig: not found, reinstall GRUB components from focal, then reconfigure:

bash
sudo DEBIAN_FRONTEND=noninteractive apt-get install --reinstall -y \
  grub-common grub2-common grub-pc-bin
sudo DEBIAN_FRONTEND=noninteractive dpkg --force-confdef --force-confold --configure -a

Post-downgrade verification

bash
cat /etc/os-release
uname -r
dpkg --audit
apt list '?obsolete'

dpkg --audit should be empty. Review obsolete packages before bulk purging—see remove obsolete packages on Ubuntu.


Step 5 — Remove unused and obsolete packages

After verification, drop packages that no longer belong on focal:

bash
sudo apt autoremove -y

For a deeper cleanup workflow, see remove unused packages on Ubuntu.


Data on /

The downgrade path above changes packages under /usr and configuration under /etc; it does not remove home directories. Personal files under /home remain on disk when aptitude completes successfully.

You can still lose access to that data if GRUB or libc6 leaves the system unbootable—restore a hypervisor snapshot, LVM snapshot, or fsarchiver archive instead of continuing on a broken hybrid system.


Troubleshooting

Symptom Likely cause Fix
apt update 404 on hirsute Release EOL on main archive Point sources.list at old-releases.ubuntu.com
AutoRemover broke stuff apt dist-upgrade on a downgrade Use aptitude dist-upgrade
Long broken-package list (cups, gdm3) Half-configured desktop stack dpkg --configure -a, apt -f install --allow-downgrades, repeat aptitude
trying to overwrite during unpack Two packages own the same file dpkg -i --force-overwrite on the focal .deb, retry aptitude
os-release still 21.04 base-files not downgraded Install focal libc6, base-files, ubuntu-minimal with --allow-downgrades
Boots old hirsute kernel on focal packages GRUB default unchanged Reboot, pick focal kernel, adjust GRUB_DEFAULT or purge old linux-image-*
grub-mkconfig: not found GRUB packages broken mid-downgrade Reinstall grub-common grub2-common grub-pc-bin
Many obsolete packages Older release kernels/meta left behind apt list '?obsolete'; purge carefully

Summary

Downgrading Ubuntu 21.04 to 20.04 LTS means retargeting sources.list to focal, pinning focal suites in /etc/apt/preferences.d/, and running aptitude dist-upgrade until the solver quiesces. Expect interruptions—desktop dependencies, overwrite conflicts, and stuck os-release are normal; repeat aptitude after dpkg --configure -a or targeted --force-overwrite installs.

Reboot into a focal kernel, verify with dpkg --audit, and clean obsolete packages. Files under /home stay on disk when the hop succeeds; snapshot restore remains the safest rollback if GRUB or libc configuration fails.


References


Frequently Asked Questions

1. Can I downgrade Ubuntu 21.04 to 20.04 LTS?

Yes, using unsupported apt pinning: back up sources.list, point apt at focal suites, add /etc/apt/preferences.d/focal pin priorities, install aptitude, and run aptitude dist-upgrade. Expect dependency errors—repeat dist-upgrade and use dpkg recovery commands in the same section where the error appears.

2. Why use aptitude instead of apt dist-upgrade for this downgrade?

apt dist-upgrade can hit AutoRemover or broken-dependency errors on a release downgrade. aptitude often resolves the downgrade graph more reliably when thousands of packages must move to older focal versions.

3. Will my files under /home survive the downgrade?

apt rewrites packages under /usr and merges config under /etc; it does not wipe home directories. You can still lose access to data if GRUB or libc leaves the system unbootable—take a snapshot or fsarchiver backup before you pin focal.

4. Do I need to reboot after downgrading Ubuntu 21.04 to 20.04?

Yes when /var/run/reboot-required exists or when uname -r still shows a hirsute kernel after packages report focal. Reboot, confirm a focal kernel exists in /boot, and set GRUB_DEFAULT if the wrong image boots.

5. What if /etc/os-release still shows 21.04 after aptitude finishes?

Install focal libc6, base-files, and ubuntu-minimal with --allow-downgrades and non-interactive dpkg flags. Pick versions from apt-cache policy for the focal candidate if apt refuses unpinned installs.

6. Is downgrading Ubuntu officially supported?

No. Canonical supports upgrades via do-release-upgrade only. Restore a VM snapshot, LVM snapshot, or fsarchiver archive when you can; reinstall is safer than forcing a downgrade on production systems.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on …