I would like to know if there is an official redirector for Ubuntu like Debian's httpredir.debian.org.

As I searched on Google, I found something on the Ubuntu Mailing Lists that was related to this, but no answer.

I also found mirrors.ubuntu.com, but I have no idea how to use it as a redirector.


Searching on Google, it appears that there is no official redirector currently.

mirrors.ubuntu.com can be used as a redirector (sort-of), by using it in /etc/apt/sources.list. For example, you can replace the following lines:

deb http://fr.archive.ubuntu.com/ubuntu/ xenial main restricted
deb-src http://fr.archive.ubuntu.com/ubuntu/ xenial main restricted

with these lines:

deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted
deb-src mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted

You can perform the change for all the lines that use a specific mirror (fr.archive.ubuntu.com in my example). Do not perform the change for http://security.ubuntu.com/ubuntu as it is important it remains as it is for urgent security releases (bypassing mirror delays).

Note: /etc/apt/sources.list is an important file. Make a backup copy before you edit it. You need to edit it as root (or rather, edit a copy as a regular user, then put the edited copy back into /etc/apt as root).

Note also that this mirror method sometimes failed in recent Ubuntu releases. I may have been fixed in 16.04, but the bug is still open: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1479045

| improve this answer | |
  • "I think this has been fixed in apt 1.1 in 16.04 or at least I haven't seen this issue in a long time." So, it is probably fixed, but I will be careful and use 16.10. Thanks! – NatoBoram Feb 2 '17 at 18:14

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.