lsb_release -a returns nothing, want to upgrade, but can't

    No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu GNU/Linux testing/unstable
Release:    testing/unstable
Codename:   n/a

I have had this version for a few years now and would like to upgrade it to 22.04 lts.

    sudo do-release-upgrade -d
    Checking for a new Ubuntu release
    Upgrades to the development release are only 
    available from the latest supported release.
deb [signed-by=/usr/share/keyrings/adoptopenjdk-archive-keyring.gpg] hirsute main

What can I do?

Asked By: mrSuperEvening


This answer will help you restore your botched /etc/os-release file (which is actually a symlink to /usr/lib/os-release).

From your kernel version, and your previous questions, it’s evident that your system is actually running Ubuntu 21.04 (Hirsute Hippo). This release is now end-of-life, and you should upgrade to a supported release ASAP.

For unknown reasons, you have overwritten your /etc/os-release file with invalid contents – let’s fix that.

Open the file in an editor (like nano) with root privileges:

sudo nano /etc/os-release

Replace the entire contents of the file with this:

VERSION="21.04 (Hirsute Hippo)"
PRETTY_NAME="Ubuntu 21.04"

Save and exit.

Now when you run lsb_release -a it should show:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.04
Release:        21.04
Codename:       hirsute

To upgrade your current installation now, please see this Q&A.

Answered By: Artur Meinild
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.