How to update sources.list for Debian 4.0 Etch?

I am trying to update my /etc/apt/sources.list on my VPS. As I run apt-get update I get all kinds of 404s not found, for example:

Failed to fetch http://debian.newdream.net/dists/etch/main/binary-amd64/Packages.gz  404 Not Found
Failed to fetch http://security.debian.org/dists/etch/updates/main/binary-amd64/Packages.gz  404 Not Found [IP: 149.20.20.6 80]
Failed to fetch http://www.ksplice.com/apt/dists/etch/ksplice/binary-amd64/Packages.gz  404 Not Found

As I look into http://www.debian.org/releases/etch/, I don't see any information regarding archives. I am inside archive.debian.org, but I am a little confused as to how to follow it's instructions/modify the sources list. Here's the contents of the current list:

deb http://debian.di.newdream.net/ etch ndn
deb http://www.ksplice.com/apt etch ksplice
deb http://debian.newdream.net etch main non-free contrib
deb http://www.backports.org/debian/ etch-backports main
deb http://archive.debian.org/debian-volatile etch/volatile main contrib non-free
deb http://security.debian.org/ etch/updates main
deb http://debian.dc-uoit.net/debian-multimedia/ etch main

From what I read on the archive README, I was thinking that the format would be something like this:

deb http://archive.debian.org/debian-security dists/etch/updates/ main

Also, after commenting out most, if not all of the lines in the sources file, I still get the same errors. Is there a command that needs to be run to clear the cache?


Solution 1:

Etch is now 2 releases beyond the end of life. There is no security support, because it is not being supported.

For the main archive use a line like this.

deb http://archive.debian.org/debian etch main

You should be upgrading to lenny, and then squeeze.

The security updates, backports, multimedia and ksplice archives are probably gone.

Solution 2:

man apt, man apt-cache, and man apt-get provide information regarding package caching maintenance.

After updating the /etc/apt/sources.list file, bear in mind that package information is stored in various places, and that just running apt-get clean or apt-get autoclean will not clear out these fouled packages (you will continue to receive a 404 error for those packages not found). You will need to clear the package cache from:

   /var/lib/apt/lists/
      Storage area for state information for each package resource specified in
      sources.list(5) Configuration Item: Dir::State::Lists.

If you do ls /var/lib/apt/lists/ you'll see a list of the resources that are causing the 404s.. There might also be package information in /var/lib/apt/lists/partial/. You might need to remove (as in rm foo-bar) those packages that are causing the 404s. Be careful not to remove those that are working.

Then if you cd into /etc/apt you will notice sources.list.d. In my case I just ran sources.list.d/* and that removed all the broken packages (after verifying the contents of sources.list.d/*, of course).

You can run apt-get check, apt-get autoclean, and apt-get update in sequence afterwards and you should come out clean.

If you are in doubt about the naming convention for the packages in the list file, you can always do man sources.list.