How to upgrade an end of life ubuntu through command line

If you are a consistent Linux user you might have  sometimes  observed that when you run the command for update and upgrade it shows an error

As well as you won’t be able to download a new application from a command line such as Vim text editor

There are many reasons for an update  not to work for an instant if you are not connected to the internet you won’t be able to update ubuntu

but in case if you get 404 errors such as “404 not found[ IP 43.255.106.254.80]”

Then  it means your ubuntu has reached the end of life

How to check the end of life of an ubuntu version

First, You can check your system version by a command

$ cat /etc/lsb-release

Check your sytem end of life from here

Click here–>

Upgrade the sources list

As you have checked your version and codename as well as you checked the end of life

If your system version reached the end of life or else you would like to upgrade your system from old version to new version  then you need to run the following commands

$ cd /etc/apt/
$ ls
$ sudo gedit ./sources.list

As we have noted that the system we have is ubuntu 18.04 with the code name bionic

Now we like to upgrade ubuntu 18.04 to ubuntu 20.04 and the code name for ubuntu 20.04 is focal

To upgrade the ubuntu from 18.04 to 20.04 you need to edit the sources list and also replace the word bionic with word focal

Note: edit only the lines which are without the hashtag symbol(#)

As you can see the lines without a hashtag is underlined

why?

because you need to replace the word bionic with focal and you need to do it till the end of the list

After you finish save the file

Now run the command called update

$sudo apt update

It will take little time to update

Next, run the command

$sudo apt dist-upgrade

If you get an error some like this (E: could not get lock /var/lib/dpkg/lock-frontend-open)when you run the above command then get rid of this error by the following command

Click here –>

Now remove the old files by command

$sudo apt autoremove --purge

Reboot

$ sudo systemctl reboot

Finally, run the last command to reboot the system then the system will get restart

If the system doesn’t start after reboot wait for few minutes

Moreover,  if you have a virtual machine then do resets a few time on the virtual box

Mohammed Anees

Hey there, welcome to aneescraftsmanship I am Mohammed Anees an independent developer/blogger. I like to share and discuss the craft with others plus the things which I have learned because I believe that through discussion and sharing a new world opens up

Leave a Reply

Your email address will not be published.