How To Resolve The “Ubuntu Repository No Longer Has a Release” Issue

Sometimes, when you run the command sudo apt update -y or sudo apt upgrade -y, you get the error message such as

The repository 'http://gb.archive.ubuntu.com/ubuntu kinetic Release' no longer has a Release file.

This error is caused because the releases sources for the ubuntu version you are attempting to update has been migrated to an archive server. So, to fix this solution, all you need to do is point the sources to the archived server.

This can be easily achieved by running the commands below

# Step 1: backup your existing source list file
$  cp /etc/apt/sources.list /etc/apt/sources.list.bak 

# Step 2: run sed to replace the sources path
$ sudo sed -i -re 's/([a-z]{2}.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

# step 3: update the OS and do a dist upgrade
$ sudo apt-get update && sudo apt-get dist-upgrade

Once the commands listed above has been executed successfully, the error message will disappear and you can then freely update your OS at any time without any hinderances.

Leave a comment