Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've configured my sources to use the mirrors:// "protocol" to find servers close to me, mainly since I move around a lot.

However, for some reason it doesn't work for all the repos - when I run sudo apt-get update I get a bunch of errors (about 45) like the following:

W: Failed to fetch mirror://  404  Not Found [Mirror:]

W: Failed to fetch mirror://  404  Not Found [Mirror:]

If I remember correctly, I configured this through the GUI, but I still went and looked what the lines corresponding to those repos said in /etc/apt/sources.list - this is what I found:

deb-src mirror:// raring main restricted
deb-src mirror:// raring universe

(I couldn't map all the errors to lines from sources.list, but I guess that's just because I'm not 100% sure what I'm looking for...)

I thought the whole point of configuring the sources like this was to make sure that chooses a mirror that has the repositories you need. Why am I getting 404 errors here, and what can I do about it?

I'd prefer to still use the mirrors setup, rather than hard-coding specific servers to get everything from, if it's possible.

Thanks to helpful comments in the first couple of answers, I've been able to rule out both server maintenance and firewall issues - I have no problem getting other things from the same server, using the mirror protocol. The problem is that the sources aren't available on the mirror I'm pointed to. In other words, all the packages are there, so lines in sources.list that start with deb have no problems, but deb-src lines fail.

I've also verified by opening e.g. in my browser. According to the error message, apt-get looks for a subdirectory of this diriectory called source, which doesn't exist. So the problem is not connecting to the server, but that the server doesn't have the resources I'm looking for.

I assume it's up to the mirror to decide whether they want to provide the sources as well or just the packages, but I'm surprised that serves me a mirror that doesn't have what I ask for. I see three options, and I don't like either:

  • Hard-code the sources for deb-src resources to servers where I know they are available, i.e. sacrifice the mirror protocol in these instances.
  • Uncheck source pacakges in Software Sources, i.e. sacrifice downloading sources for the packages.
  • Ignore the error messages from apt-get and hope points me to a different server in the future.

Is there a fourth option, that actually solves the problem? =)

share|improve this question

The mirrors protocol has choosen the nearest mirror server, which is But in this case, failed respond with a valid response. (May be they were doing a little maintenance)

And it looks like, its up and running, by the time of this writing.

Please try again. Your problem might have got resolved. :)

This is what I got when I opened that URL from the browser.

enter image description here

If you see, there are two items which got last modified today.

share|improve this answer
Thanks for your help! This helped me rule out some of the possible error causes, but it didn't solve my problem - please see my update. – Tomas Lycken May 3 '13 at 17:43

If it is only the deb-src packages that are failing, this is not a problem. The deb-src only contain source code, so unless you are hacking the source code yourself you don't really need them (generally speaking. There are occasional exceptions).

Nevertheless, I've seen this happen when moving around to different networks for various reasons. Try the following to see if they help:

  1. Clean the downloaded packages in case a mirror is failing due to version mismatch: sudo apt-get clean. This fixed the issue once, but it could have been a coincidence. It's easy to try though.
  2. Check that a firewall isn't blocking your outbound packets. Normally apt uses outbound ports 80 (for HTTP) and 21 (for FTP). If an egress firewall is blocking these, it could cause you problems. I don't know exactly which port the miirrors protocol uses, but it needs to be allowed through the firewall as well. There are a few different ways to figure out the ports. Let me know if you need guidance. Also ensure that a firewall isn't blocking inbound packets either. This isn't usually a problem because most firewalls are stateful and they expect responses back to connections originating inside the network.
  3. Check your proxy settings. Usually setting the proxy to "auto" is sufficient, but sometimes it isn't. Check with the network admin to see if you need special proxy settings. Some proxies treat apt traffic differently than regular HTTP.
share|improve this answer
Thanks for your help! This helped me rule out some of the possible error causes, but it didn't solve my problem - please see my update. – Tomas Lycken May 3 '13 at 17:42

I had this problem a well on Raspbian as a particular package was getting redirected to a mirror/archive hosted at The archive server at isn't responding and not reachable ... what do do?

In my example, I was trying to install the package 'pptp-linux'. I needed to find a mirror for Raspbian which has this package. You may need to find a mirror for your distribution flavor and the example for mine was listed here:

I picked one in the US and added it to my /etc/apt/sources.list at the top of the file:

deb wheezy main contrib non-free rpi

Save the changes and then update the apt-get:

apt-get update

Lots of updating, zoom zoom ... and then trying to install my package and apt-get downloads from the new mirror. Complete!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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