Since this seems to be one of the main "Failed to fetch" answers, I just want to point out here that this also can happen with Ubuntu "partner" URLs in the sources.list; check your errors to see if those are the ones and try commenting them out. I ran into that issue (and solution) upgrading from Quetzal.
–
joseph_morrisMay 14 '14 at 22:31

Note a # at the front of a line of text means that it is commented out and is not checked by the package manager.

How to eliminate these errors

Typically, if you run sudo apt-get update from a terminal or click the details button in Update Manager after hitting the refresh button you will see errors such as:

If the error is due to a PPA - usually unticking the similarly named PPA with the URL shown in the error message will resolve this.

If the 404 error was due to an additional repository that has been added to /etc/apt/sources.list then its easier to add # character to the start of the line to comment out the offending repository i.e.

gksu gedit /etc/apt/sources.list

Scripted removal for all ubuntu versions prior to 15.04

I've written a quick script that checks for PPAs and Software-Sources that exhibit the 404 errors. This works for all Ubuntu versions before 15.04. For 15.04 and later perform the manual methods described above.

How to investigate this and come to this conclusion?

These are the error messages you receive for wdt-main PPA:

W:Failed to fetch http://ppa.launchpad.net/petrakis/wdt-main/ubuntu/dists/quantal/main/source/Sources 404 Not Found
, W:Failed to fetch http://ppa.launchpad.net/petrakis/wdt-main/ubuntu/dists/quantal/main/binary-amd64/Packages 404 Not Found
, W:Failed to fetch http://ppa.launchpad.net/petrakis/wdt-main/ubuntu/dists/quantal/main/binary-i386/Packages 404 Not Found

Open your browser tab and open the link which gives 404 Not Found Errors. In this case http://ppa.launchpad.net/petrakis/ and go deeper as per the link which gives errors. You would be able to see what the actual problem is.

Awk searches for the line which consists of W:,launchpad,404 in the /tmp/update.txt file.If it found that then in that line it displays(stdout) all the letters starting from the 26th location in column5.This standard output was redirected(written) to the /tmp/awk.txtfile.

For example:

W: Failed to fetch http://ppa.launchpad.net/pitti/postgresql/ubuntu/dists/saucy/main/binary-i386/Packages 404 Not Found

in that 5th column start from 26th character- pitti/postgresql/ubuntu/dists/saucy/main/binary-i386/Packages

This above line was stored into /tmp/awk.txt file.Now the next command,

awk -F '/' '{ print $1"/"$2 }' /tmp/awk.txt > /tmp/awk1.txt;

awk findout out the column1 and column2 with the delimiter / where the column1 and column2 are concatenated by /from the /tmp/awk.txt file and then redirects(written) the stdout to /tmp/awk1.txt file.

Now /tmp/awk1.txt file contains pitti/postgresql line.

uniq /tmp/awk1.txt > /tmp/awk2.txt

If there are two same lines, unique command displays(stdout) single line only.That single line was written to /tmp/awk2.txt
Finally /tmp/awk2.txt consists of unique PPA names.

tput sgr0

This command changes the colour of terminal text into white.

Finally if conditional statements will executes. if [ -s /tmp/awk2.txt ] check for the contents of /tmp/awk2.txt file presents or not.If yes, then it takes the first line from /tmp/awk2.txt and executes sudo add-apt-repository -r ppa:$line command.It continues upto to the last line.

If no, it means there is no contents.So it says "No PPA's to be removed".

this just saved a duplicate question from being posted.. I had the body of my Q ready and just as I started to type my title found the link.. why don't they keep all the list at a place! there are some listed in /etc/apt/sources.list where I did check but didn't know I had to look in /etc/apt/sources.list.d/ too.. thanks..
–
preciseMar 12 '14 at 11:15