Score:0

How to upgrade 20.04 to 20.04.6 from command line?

de flag

I have found a computer with Ubuntu 20.04 LTS that I did not use half a year, and I wanted to update the packages to the recent ones. I thought 20.04 LTS is supported through 2025, so I issued

$ sudo apt update
$ sudo apt upgrade

and got this:

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

OK, interesting. So I checked I have

$ gcc --version

gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0

and logged into some other machine with Ubuntu 20.04 LTS, where I get

gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

OK, interesting... so let's check the Ubuntu version again then:

Here:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:    20.04
Codename:   focal

There:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:    20.04
Codename:   focal

There you get it! Wow. What now, ok, let's try do-release-upgrade

$ do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]                                                                 
Get:2 Upgrade tool [1 266 kB]                                                                        
Fetched 1 267 kB in 0s (0 B/s)                                                                       
authenticate 'jammy.tar.gz' against 'jammy.tar.gz.gpg' 
extracting 'jammy.tar.gz'

Reading cache

Checking package manager
Reading package lists... Done
Building dependency tree        
Reading state information... Done

Required depends is not installed 

The required dependency 'apt (>= 2.0.4)' is not installed. 

Oh, no. I do not want jammy 22.04. And it even does not work. What a mess! I just want to update my 20.04 LTS. The software updater graphical window pops up and tells me there is 20.04.02 available suggesting to upgrade. Cool, but noooo. I do not want to use graphical software updater. I want to use the good old style (soon to be killed by... [censored]) apt family tools. I believe there is an easy way, but google search on upgrade from 20.04 to 20.04.06 tells... nothing.

Which part of the Ubuntu story am I missing, please?

P.S. Oh, and BTW. When trying to post the question from firefox on that 20.04 system, the [Review question] button did not work... I had to run a remote firefox from the other machine with 20.04.6 over a slow X connection :(

The console reported:

SyntaxError: invalid regular expression flag s  in ask.en.js:62:34216. WTFU!?

New discoveries based on comments:

$ sudo apt update
Hit:1 http://en.archive.ubuntu.com/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

More exciting news based on the latest comment:

(apart from some commented lines) this is the content of my /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ focal main restricted
deb http://archive.ubuntu.com/ubuntu/ focal universe
deb http://archive.ubuntu.com/ubuntu/ focal multiverse

In fact yesterday it was sk.archive.ubuntu.com, and I tried to change it to en.archive.ubuntu.com with no result, now I changed it directly to archive.ubuntu.com, which again as last time redownloaded the package lists, but had no other useful outcome, see below:

$ sudo apt update
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:2 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [970 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal/main i386 Packages [718 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal/main Translation-en [506 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 DEP-11 Metadata [494 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal/main DEP-11 48x48 Icons [98,4 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/main DEP-11 64x64 Icons [163 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/main amd64 c-n-f Metadata [29,5 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [22,0 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/restricted i386 Packages [8 112 B]
Get:11 http://archive.ubuntu.com/ubuntu focal/restricted Translation-en [6 212 B]
Get:12 http://archive.ubuntu.com/ubuntu focal/restricted amd64 c-n-f Metadata [392 B]
Get:13 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8 628 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal/universe i386 Packages [4 642 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5 124 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal/universe amd64 DEP-11 Metadata [3 603 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal/universe DEP-11 48x48 Icons [3 016 kB]
Get:18 http://archive.ubuntu.com/ubuntu focal/universe DEP-11 64x64 Icons [7 794 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse i386 Packages [74,7 kB]
Get:22 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Get:23 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 DEP-11 Metadata [48,4 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal/multiverse DEP-11 48x48 Icons [23,1 kB]
Get:25 http://archive.ubuntu.com/ubuntu focal/multiverse DEP-11 64x64 Icons [192 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9 136 B]
Fetched 36,9 MB in 12s (3 061 kB/s)                                            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

and same for sudo apt full-upgrade. Is this some kind of mystery?

The last comment also mentioned something about security, I have noticed I have some commented out deb-src eoan-security lines at the end of the file, so I have added three more lines:

deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

with the following outcome:

$ sudo apt update
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease                               
Get:3 http://security.ubuntu.com/ubuntu focal-security/multiverse Sources [12,2 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/restricted Sources [50,9 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main Sources [287 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/universe Sources [180 kB]
Fetched 644 kB in 1s (561 kB/s)                   
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
petrovic@pisek:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

But that was deb-src, and we may need just deb, ok, adding three more lines:

deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse

and this finally solved it! Now I Got

592 upgraded, 12 newly installed, 0 to remove and 0 not upgraded. Need to get 733 MB of archives.

Wonderful, thank you for the help, machine is updated!

guiverc avatar
cn flag
If you apply all upgrades (`apt full-upgrade` maybe necessary and not just `apt upgrade`) with your software lists correct & updated (ie. `sudo apt update` first & ensure all output is good) you'll be using the latest system post-upgrade & maybe post-reboot.... (*mirror issues etc. can also be a problem - read the output of `sudo apt update` first!*)
guiverc avatar
cn flag
FYI: The `do-release-upgrade` command is used to upgrade a 20.04 (or *focal*) system to the next release (20.10 or *groovy* but that option disappeared when *groovy* went EOL) **OR** or to the next LTS which is 22.04 (or *jammy*). It changes the sources & more (*to ensure success including ensuring packages update in specific order - Ubuntu isn't Debian though close*) before it runs the `apt update` & `apt full-upgrade` type operations.. thus is a different thing to what you're asking as I understand it...
de flag
Thanks @guiverc. I seem to be still stuck. Update the question at the bottom with full-upgrade attempt.
user535733 avatar
cn flag
Does this answer your question? [How do I restore the default repositories?](https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories) Your `apt update` output shows that you are missing the `-security` and `-update` repos. Sometime in the past, you turned off updates a particularly bad way.
de flag
Thank you @user535733 for the hint, I have added some new insights at the end of the post, not sure if that is what you meant?
de flag
So it was the security updates missing. Interesting. Thank you for all the ideas and help. Much appreciated!
Score:1
us flag

No mystery here.

As mentioned by user535733 in a comment, your system is doing exactly what you have set it up to do.

Specifically, you only have the main repo in your sources list. That gets you the original delivered system with no updates.

You need to add the updates and security repos to your sources list.

Copy the sources list from the fully updated system to this system.

de flag
Yes, now I see there are focal-updates and focal-security items in the fully updated system, so I add also the updates, not only security. Interesting it was not there, but happy to have found the issue! :) Thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.