PPA seems to be constantly offline. Whenever I use sudo apt-get update
, this error is shown:
W: Failed to fetch http://ppa.launchpad.net/ 404 Not Found
How do I fix these errors?
PPA seems to be constantly offline. Whenever I use sudo apt-get update
, this error is shown:
W: Failed to fetch http://ppa.launchpad.net/ 404 Not Found
How do I fix these errors?
Automated removal
skip to the bottom of this answer for a scripted way to remove offending software-sources for all ubuntu versions prior to Ubuntu 15.04
What are 404 errors
What are the causes of these errors in update-manager
Typically, three main areas cause these errors in
update-manager
where are these software-sources
PPAs typically are saved in one of two locations
/etc/apt/sources.list
/etc/apt/sources.list.d/
for examplewebupd8team-jupiter-natty.list
This list file typically contains:
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.More info
Here is a bug report on the update manager to solve this problem:
If you are getting these problems without PPAs, check out this question:
Automated Removal of 404 Not found PPA's through script
This is a script to remove automatically all the 404 Not found PPA's. Copy the below code and paste it into a file and name it as
ppa-remove
.Give execute permission to the script
Copy and paste the
ppa-remove
file into/usr/bin
directory.So that you can access it from anywhere.Usage
Script Description
tput setaf 6
command turns the terminal text colour into green.And then it displays "Initializing ..Please Wait" in green colour.sudo apt-get update >> /tmp/update.txt 2>&1;
Both stdout and stderr of the command
sudo apt-get update
are written to the file/tmp/update.txt
awk '( /W:/ && /launchpad/ && /404/ ) { print substr($5,26) }' /tmp/update.txt > /tmp/awk.txt; awk -F '/' '{ print $1"/"$2 }' /tmp/awk.txt > /tmp/awk1.txt;
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.txt
file.For example:
5th column -
http://ppa.launchpad.net/pitti/postgresql/ubuntu/dists/saucy/main/binary-i386/Packages
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
find out 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 containspitti/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.This command changes the colour of terminal text into white.
Finally
if
conditional statements will execute.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 executessudo add-apt-repository -r ppa:$line
command. It continues up to the last line.If no, it means there are no contents. So it says "No PPA's to be removed".
Screenshots
You are getting these errors because your PPA repositories don't provide packages for your distribution of Ubuntu (ie;
quantal
).Look at the following screenshots:
ppa:petrakis/wdt-main
ppa:screenlets/ppa
You can see that the directory for
quantal
is missing and hence you are getting404 Not Found Error Messages
.To get rid of these messages you have to remove these PPA repositories from your system. Follow this question on how to remove PPAs:
How to investigate this and come to this conclusion?
These are the error messages you receive for
wdt-main
PPA: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.The most probable that it's happening is that the PPA is not longer maintained and needs to be removed. You can do this just using:
Choose Older Repository
If you're really need the packages from that repository, you can use the mirrors from older release.
However, please note that not all older releases are backward compatible; some of them causes conflicts with your main package repository.
The only thing you can do when it conflicts is either building from source or wait until the provider releases the repository for your Ubuntu version. We don't know exactly when the package providers will release their package for our version, so you're the one in charge to check their repository for your release.
This can be used with any Debian-based repository. However, there is no guarantee that this will be successful.
Steps
sudo apt update
after adding PPA/repository. You can notice that there are 404 errors while updating; just ignore this.https://dl.winehq.org/wine-builds/ubuntu
. Usually, available releases are located indists/
.bionic
withartful
.sudo apt update
again.If you are getting a 404 error trying to obtain security or system files from an official repository (not a PPA) you can chose a different mirror to resolve this issue.
You can either:
A) determine one Manually by reviewing this list and choosing the most current mirror. (you may wish to take into consideration other factors such as distance and bandwidth) or
B) Choose one automatically.
Either way you can start with the Software & Updates application as shown below: Then Select Download from followed by Other. Then you can either manually choose the mirror of your choice from the list or click the Select best Server button which will run some tests and choose the best server for you dependent on current conditions.
Note that it already happened to me and I was out of these situations. And it also worked for a friend of mine. Even not being able to explain why, there is something that solved that problem:
sudo apt-get update
from terminal;sudo apt-get update
;And suddenly it worked. Do not ask me why.
I have tried every possible answer, but the only solution was to copy the Ubuntu 16.04 Xenial default /etc/apt/sources.list file to my
/etc/apt/sources.list
.Sources: https://gist.github.com/rohitrawat/60a04e6ebe4a9ec1203eac3a11d4afc1
That saved my Linux.
> You sources are messed up/or corrupted, but we can make a new fresh list.
sudo software-properties-gtk