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.

Manuel Jordan
  • 1,768
  • 7
  • 30
  • 50

1 Answers1

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.)

  • Thanks for the reply, seems all your commands are for the 2nd scenario requested, right? – Manuel Jordan Apr 14 '21 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? – Manuel Jordan Apr 14 '21 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 '21 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. – easthighNerd Apr 16 '21 at 00:09