*Error* for Sudo apt-get update on ubuntu 20.04
I've just recently installed Ubuntu 20.04 on my PC. When I try to sudo apt-get update in a new terminal, it gives me this error:
Hit:1 http://ppa.launchpad.net/git-core/ppa/ubuntu trusty InRelease
Err:2 http://my.old-releases.ubuntu.com/ubuntu focal InRelease
Could not resolve 'my.old-releases.ubuntu.com'
Ign:3 http://old-releases.ubuntu.com/ubuntu focal-security InRelease
Err:4 http://old-releases.ubuntu.com/ubuntu focal-security Release
404 Not Found [IP: 91.189.91.123 80]
Err:5 http://my.old-releases.ubuntu.com/ubuntu focal-updates InRelease
Could not resolve 'my.old-releases.ubuntu.com'
Err:6 http://my.old-releases.ubuntu.com/ubuntu focal-backports InRelease
Could not resolve 'my.old-releases.ubuntu.com'
Reading package lists... Done
E: The repository 'http://old-releases.ubuntu.com/ubuntu focal-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
How do I rectify this error? Thanks and I look forward to your answer shortly.
Ubuntu 20.04 LTS (focal) is actual release, so its packages are located in archive, not old-releases. You can fix this problem by using commands below:
sudo sed -i "s/my.old-releases/archive/g" /etc/apt/sources.list /etc/apt/sources.list.d/*.list
sudo sed -i "s/old-releases/archive/g" /etc/apt/sources.list /etc/apt/sources.list.d/*.list
and then update package lists by
sudo apt-get update