How to upgrade the repositories locations from focal to jammy? (apt update)

Hello Friends

Through VirtualBox was installed long time ago Ubuntu Desktop 20.04 (focal) and was upgraded successfully to 22.04 jammy

Now, the reason of this post, when the sudo apt update command is executed appears:

sudo apt update
Hit:1 http://repo.mysql.com/apt/ubuntu focal InRelease
Hit:2 https://download.docker.com/linux/ubuntu focal InRelease                                                                       
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease                                                                        
Hit:4 http://security.ubuntu.com/ubuntu jammy-security InRelease                                                                     
Hit:5 http://pe.archive.ubuntu.com/ubuntu jammy InRelease                            
Hit:6 http://pe.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:7 http://pe.archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
11 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

Observe the two first lines, they contain the focal term, and the others lines contain the jammy term.

How to upgrade the repositories locations from focal to jammy?

The goal is update correctly MySQL and Docker.

3 Likes

You go to /etc/apt
and there should be a file called sources.list
Make a backup copy, eg
cp sources.list sources.list.orig
then edit sources.list
vi sources.list
and change the word focal to jammy

in some distros there are several .list files
and they are in /etc/apt/sources.list.d

You will need to use su or sudo
I dont think you need to reboot after editing

2 Likes

Thank you, let me test it tomorrow with the brain refreshed :slight_smile:

1 Like

Hello @nevj

Could you consider see this question?

It is a consequence about your solution. Thanks in advance

I have never needed to use apt-key
Ubuntu has a rather complicated set of repos.
Debian is simple.
Inline upgrades can be tricky if you have non-standard repos or a custom kernel.