Monday, April 22, 2013

Ubuntu apt-get update Err http://us.archive.ubuntu.com/ubuntu/ 404 Not Found [IP: w.x.y.z]

Ubuntu as any other OS should be upgraded when the time comes. Keeping an unsupported version of the OS is a no-no. Yet for whatever reason it looks on the technology side we need to deal with upgrades in servers that have not been patched. When you say that the solution is an upgrade and that it will take longer the statement, believe me, will be not appreciated.

In those case you better try to correct the issue even if providing a non-secure solution and later state what should be done ASAP to avoid possible exploits to compromise your outdated servers.

Commonly the first problem arises when you try to install a package in an old distro:
$ sudo apt-get  install nfs-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package nfs-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'nfs-common' has no installation candidate
To illustrate a possible "fix" with an example let us say you get the below error when trying to update an old maverick distro:
Err http://us.archive.ubuntu.com/ubuntu/ maverick-updates/main portmap amd64 6.0.0-2ubuntu1.1 404 Not Found [IP: 91.189.91.13 80]
Maverick is not longer a supported release so it won't be found in the original servers. You need to look for them in the old-releases server so most likely the below will work:
sudo sed -i 's/us.archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
Most likely you will get then some key related issues like:
W: GPG error: http://old-releases.ubuntu.com maverick-security Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5
Which you can solve with:
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
Now you should be able to install that package which was missing in your old distribution. However let me state this once again, you should never rely on this procedure. You should always upgrade your distribution. To safely upgrade the distribution I believe automated server management in terms of recipes is the way to go.

No comments:

Followers