How do I Upgrade Ubuntu from the Terminal?

If you are a computer enthusiast, you might have experience working with multiple operating systems. For a given operating system, it is good to use the latest release for several reasons. First, the latest release includes the latest software upgrades, which will protect you from potential bugs. Second, newer versions tend to be more secure than older versions. In this article, we will teach you how to upgrade Ubuntu from the Linux terminal. Note that, in this article, we use Ubuntu 20.04 LTS.

First, you need to search for Ubuntu terminal in the Activities search menu. Then, launch it by clicking on it, as highlighted in the image below:

When you click on the highlighted search result, your Ubuntu terminal will immediately open, as shown in the following image.

After launching the terminal, update your system to fix all the broken dependencies and links so that you can conveniently upgrade your system. The Ubuntu system can be updated by running the command $ sudo apt-get update.

Any operation related to updating and upgrading an operating system requires root user privileges. Thus, it is mandatory to use the sudo keyword before these commands. Once your Ubuntu system is finished updating all the packages, the following output will be displayed on your terminal:

After updating your system, upgrade it by running the command $ sudo apt-get upgrade.

When you run this command, you need to confirm that you want to consider this process by entering “Y” in your terminal when asked to, as highlighted in the following image.

You have to be patient after running this command because it takes quite a long while to execute. For us, it took approximately 60 minutes with a moderate Internet connection to complete the update. Once the update is finished, your system will display the following output:

Now, to make your system more efficient, you need to run the following upgrade command in your terminal: $ sudo apt-get dist-upgrade. This command not only upgrades the packages that need to be upgraded but also removes the ones that are no longer required by the system.

Since this command may attempt to remove installed or newly upgraded packages, your terminal will ask you to consent to continuing this process, as discussed above.

Once your upgraded packages have been handled, you will see something like this message on your Ubuntu terminal:

Now, reboot your system so that all the changes can take effect. To reboot your system via the terminal, run the command $ sudo reboot.

As your Ubuntu system reboots, you will see the screen shown below:

Now, you will be prompted to log into your user account, which you can do by clicking the desired user account and then entering its password.

At this point, all the formalities of upgrading the Ubuntu system via the terminal have been completed. However, before you run the release upgrade command, you should check the help pages for this command. To access the help pages, run the following command in your Ubuntu terminal: $ sudo do-release-upgrade –help.

This command will show you the syntax of the specified command and all the variations and parameters with which this command can be used, as shown in the following image:

As shown in the image above, the do-release-upgrade command can be used with the -d flag to upgrade your system from the support release to the latest development release.

In our case, since we were already using the latest version of Ubuntu, i.e., Ubuntu 20.04 LTS, system will tell us via the terminal that there is no newer version available, as shown in the following image. However, if you are using an older version of Ubuntu, then running this command will upgrade your operating system to the latest available release.

Once you have executed this command successfully, you can verify that your Ubuntu system has been upgraded by running the command $ lsb_release –a.

Running this command will show you the version of your Ubuntu system on the terminal. If it is Ubuntu 20.04, which is the currently the newest version, then your Ubuntu system has been successfully upgraded.


By following the tutorial in this article, you can upgrade your Ubuntu system to the latest available version. This process is simple but requires patience because the whole process takes approximately two hours to complete.

About the author

Aqsa Yasin

Aqsa Yasin

I am a self-motivated information technology professional with a passion for writing. I am a technical writer and love to write for all Linux flavors and Windows.