1

I have Ubuntu Server and Desktop 18.04 and 20.04, 4 releases (it through VirtualBox)

I want to know the correct and best approach to accomplish through only commands the two following scenarios:

  1. upgrade from 18.04 to 18.10 (or higher of the same release - i.e. 18.15 - if exists of course)
  2. upgrade from 18.04 to 20.04 (or higher of the latest release - i.e. 20.10 - if exists or course)

Therefore I am able to choice any of them.

I did do research and I found these commands

  • sudo do-release-upgrade -d
  • sudo apt full-upgrade
  • sudo apt dist-upgrade

Sadly there is no one page covering the three commands together to understand how each one works and when is mandatory use one over the others. So I created this post to avoid do a wrong choice.

2
  • 3
    Ubuntu version are based on year and month of release. I have never heard of the 15th month of the year. So, there was no Ubuntu 18.15. Ubuntu 18.10 has already reached its end of life. So you cannot upgrade to a now obsolete version. Your only option is version 20.04 LTS. Use the command sudo do-release-upgrade. Note, there should be no -d in the end.
    – user68186
    Apr 14, 2021 at 2:26
  • 1
    See Should I do a direct upgrade from 16.04 to 19.04? for an answer to a similar question.
    – user68186
    Apr 15, 2021 at 16:40

1 Answer 1

4

Run sudo apt full-upgrade first to make sure all your software is fully up-to-date, then run sudo do-release-upgrade and you should be good to go!

Be sure that you backup anything of importance on your system(s), just to be on the safe side, and also note that any third-party repositories you may have will be disabled for the upgrade process, and will need to be re-enabled afterwards to the proper repo version (i.e. changing the bionic in the repo string to focal.)


You can also run do-release-upgrade -c to just check if there is an upgradable release available (which for an 18.04 system, there will be.)

5
  • Thanks for the reply, seems all your commands are for the 2nd scenario requested, right? Apr 14, 2021 at 12:27
  • About and also note that any third-party repositories you may have will be disabled for the upgrade process, and will need to be re-enabled afterwards to the proper repo version I am assuming that is for ssh, mysql, postgresql, mongodb etc ... right? That process about disable and enable is automatic? Or must be done automatically? Apr 14, 2021 at 12:29
  • 2
    @ManuelJordan ssh etc. are not third party apps, unless you have installed some special version from PPA. In any case disabling is automatic, but enabling them is not, as sometimes PPA maintainers don't have a PPA for the most recent version of Ubuntu. So you may want to enable them one at a time and verify that they work after the upgrade to the new version.
    – user68186
    Apr 15, 2021 at 16:28
  • 1
  • 1
    @ManuelJordan 1) Yes, the information I've provided is for your second scenario, as 18.10 went out of support in July/August of 2019, since it was an interim release. 2) Third party repositories being, for example, the PPA for NeoFetch (ppa:dawidd0811/neofetch,) not actual software, such as ssh. @user68186 's comment above provides some additional detail in regards to this. Apr 16, 2021 at 0:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .