0

I upgraded from Ubuntu 16.04 to 18.04.1 LTS unexpectedly using below commands,which should be 18.04.6 LTS

sudo apt-get update && sudo apt-get upgrade

sudo reboot

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic
karel
  • 114,770
  • The command apt should not change your release, so please be specific as to how you release-upgraded... apt cannot change your sources, thus you'll upgrade from 18.04.1 for example to 18.04.2, but not change from 18.04 to any other release. How did you determine you're using 18.04.1? as you're likely not using 18.04.1 if you release-upgraded correctly. FYI: If you man apt-get you'll read that not all packages are upgraded... which is why apt-get dist-upgrade exists; performing the apt-get upgrade without the restrictions of upgrade... – guiverc Mar 28 '23 at 09:12
  • how can I upgrade from 18.04.1 to 18.04.6? – focus zheng Mar 28 '23 at 09:41
  • do-release-upgrade -c Checking for a new Ubuntu release New release '20.04.6 LTS' available. Run 'do-release-upgrade' to upgrade to it. – focus zheng Mar 28 '23 at 09:42
  • Please add additional details to your question; this is a Question & Answer site & not a forum (comments are just that; comments to the Original Poster or prior commentator) Your question mentions xenial or 16.04 & bionic or 18.04 only; no mention of 20.04 (or focal) is present. – guiverc Mar 28 '23 at 09:43
  • 1
    The next available release is 20.04.6 which is output of "do-release-upgrade -c".My question is why 18.04.6 is not available in my server,as I want to upgrade it to 18.04.6 only. – focus zheng Mar 28 '23 at 09:48
  • I'm not sure what you're actually running, what do you see if you ask your system, ie. lsb_release -a shows what specifically (please don't answer via comment; comments are directed to the Original Poster which is yourself!; add the details to your question; readers will read & answer your question text) – guiverc Mar 28 '23 at 09:50
  • understood,thanks for your remind – focus zheng Mar 28 '23 at 09:53
  • To fully upgrade a system, firstly you sudo apt update to update your machine software lists (ie. list of packages of what is available). Check to see all details are present in the lines that are shown, none missing, no warnings/errors & the mirror being used appears valid (you can check to see if current etc if required, but I usually only do this if there are problems after next command), then with updated software lists you apply the upgrades using sudo apt full-upgrade. that will upgrade a 18.04 system to the latest packages (18.04.1 to 18.04.6 for example here) – guiverc Mar 28 '23 at 09:56
  • 1
  • It is helpful.what makes me confusing is "apt-get upgrade" upgrade my release directly. – focus zheng Mar 28 '23 at 10:30

1 Answers1

1

You should update and upgrade the package list respectively.sudo apt-get update and sudo apt-get upgrade and then you have to update the release to the latest point release by running the command sudo apt-get dist-upgrade.

You can even check the version of Ubuntu after whole process by running the command lsb_release -a.

WARNING :: It's important to backup your important data to avoid any data loss before upgrading your system.

  • why not use do-release-upgrade? – focus zheng Mar 28 '23 at 10:31
  • 2
    do-release-upgrade is part of the Ubuntu Release Upgrader toolset which causes a number of extra tools; including change your release from bionic (18.04) to cosmic (18.10) OR to focal (20.04) - ie. changing release; disabling screensaver (if running) etc... ie. that doesn't keep you on the same release.. apt in contrast just upgrades packages ON THE SAME RELEASE (ie. you remain on bionic which is 18.04). – guiverc Mar 28 '23 at 10:34
  • 2
    If you read man apt-get and look at dist-upgrade you'll read "dist-upgrade in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The dist-upgrade command may therefore remove some packages." ie. it does more than apt-get upgrade will do. – guiverc Mar 28 '23 at 10:35
  • Hi Kumar,"apt-get upgrade" make it upgrade to 18.04.6 directly – focus zheng Mar 29 '23 at 02:06
  • Running "apt-get upgrade" will upgrade your Ubuntu packages to their latest available versions, but it will not upgrade your Ubuntu release from 18.04.1 LTS to 18.04.6 LTS directly.
    To upgrade to the latest point release, you need to run "apt-get dist-upgrade" after running "apt-get update" and "apt-get upgrade". The "dist-upgrade" command will upgrade your Ubuntu release to the latest available point release.
    – Prabhash Kumar Jha Mar 29 '23 at 02:21
  • To upgrade from Ubuntu 18.04.1 LTS to 18.04.6 LTS, you should run 'sudo apt-get update', 'sudo apt-get upgrade', 'sudo apt-get dist-upgrade'. You can check the version by running the "lsb_release -a" command. – Prabhash Kumar Jha Mar 29 '23 at 02:24
  • yes I did,it seems to work.the kernel version is upraded as well. – focus zheng Mar 29 '23 at 08:55