after using ubuntu for about a year, it's time to pose my first question.
I am running ubuntu 12.04.3 and recently I've had some issues with resynchronizing the package index files.

sudo apt-get update produced these errors:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/hardy-security/main/source/Sources  404  Not Found
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/hardy-security/main/binary-amd64/Packages  404  Not Found
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/hardy-security/main/binary-i386/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

A look at my /etc/apt/sources.list reveals the following:

# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ oneiric main restricted
# deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ dists/oneiric/main/binary-i386/
deb http://security.ubuntu.com/ubuntu hardy-security main
deb-src http://security.ubuntu.com/ubuntu hardy-security main
deb http://archive.ubuntu.com/ubuntu precise main restricted
deb-src http://archive.ubuntu.com/ubuntu precise main restricted
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb http://archive.ubuntu.com/ubuntu precise universe
deb-src http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe
deb-src http://archive.ubuntu.com/ubuntu precise-updates universe
deb http://archive.ubuntu.com/ubuntu precise multiverse
deb-src http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-security main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted
deb http://archive.ubuntu.com/ubuntu precise-security universe
deb-src http://archive.ubuntu.com/ubuntu precise-security universe
deb http://archive.ubuntu.com/ubuntu precise-security multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main

Apparently, the file contains two Hardy repositories, which cause the problem, as Hardy has reached its EOF, as can be seen here.

I found two possible solutions to this problem:
1. change the url for the hardy repositories from http://security.ubuntu.com/ubuntu to http://old-releases.ubuntu.com/ubuntu (old releases server, source)
2. remove / replace the hardy repositories

So here are the questions for you:
1. which approach should I pursue? (I think the second one, as using outdated repositories isn't a good idea anyways, see e.g. here)
2. if I choose the second approach, can I simply delete the hardy-security repos (as the corresponding precise repos are already contained)? Is this procedure safe in terms of system stability?

Thanks in advance,

  • Though the Hardy repos are obsolete in your case, your question helped me to get the repos working again on one of my old machines not yet migrated. Thanks for that! – Izzy Oct 3 '13 at 15:14

Delete the hardy lines. They're not needed. You already have modern precise versions of the -security repo so there's nothing else to do.

And yes, this should be perfectly safe. The repos are already not doing anything (they're 404ing so aren't contributing to the current available package list) and even if they were working, all its packages should have been superseded by more modern packages in precise-security.

I'd be curious to know how you ended up with hardy repos in your sources. Looks like you installed at Oneiric so this isn't a hangover from an original install… Very odd.

  • I've installed at Oneiric and upgraded to Precise. I can't remember to ever have touched source.list (as I only became aware of it when the issue arose)... – curly_pinguin Sep 25 '13 at 21:27
  • If you want a single command line to solve this use sudo sed '/hardy/d' /etc/sources.list. – Braiam Sep 26 '13 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.