Httpredir: a Cloud for Package Installation

For years, netselect-apt was the main Debian tool for choosing the fastest mirror for downloads. Two months ago, however, httpredir become hosted by the main Debian site, and promises to become a major rival.

Inspired by mirrorbrain and geoDNS, httpredir is as much for site administrators as for end users. Aware of almost 400 mirrors, httpredir automatically routes package installation requests to the currently fastest mirror — which can mean the one least being used. This ability makes httpredir much more flexible and up to date than netselect-apt can hope to be, although customizing it is somewhat more difficult.

Httpredir is set up to use http sites and either repository names (jessie, wheezy, sid), or descriptions (stable, testing, unstable, experimental). To prepare httpredir for use, open /etc/apt/sources list in a text editor while logged in as root, and change the repository addresses so that everything is routed through the address http://httpredir.debian.org/debian (or the address for your own httpredir set up — see below). For example, the address for Debian’s current stable release, jessie, should read:

http://httpredir.debian.org/debian jessie

Similarly, the address for jessie’s backports repository is:

deb http://httpredir.debian.org/debian jessie-backports main/

And so on.

When you have finished, run apt-get update, and httpredir is ready for use.

You can also set up your own copy of httpredir on an Apache site, as well as an actual mirror or a peer to peer site, and disable or add mirrors in httpredir’s database. Be aware that you need to be careful about the sites you add since the process can be quite involved. Refer to httppredir’s README file for detailed instructions and samples for each of these tasks.

Httpredir’s advantages are obvious: unlike with netinstall-apt, you do not have to edit your sources.list to add new sites or delete obsolete ones. Moreover, to ensure its availability, httpredir has three hosts. Essentially, it is a cloud service for administrators.

However, whether you choose httpredir over netinstall-apt depends on your preferences. For one thing, httpredir does not currently support ftp sites, although it is in rapid development and soon might.

For another, httpredir reads your geolocation to help select the fastest mirror for you. This involves sending of a piece of information that security conscious users may prefer not to reveal.

In addition, some administrators may prefer netselect-apt‘s hands-on approach, so they know what is happening on their systems at each step and have the final say when applying changes. In particular, those who need to avoid mirrors that include legally ambiguous software might want to know they are not accidentally visiting a site they would prefer not to use. In such a circumstance, you should set up your own version of httpredir, and regularly edit the database.

However, if efficiency and flexibility are your only concerns, httpredir is unquestionably a major improvement over netinstall-apt.

Cover photo: Directions by ppalmieri for FreeImages.com.

[sharedaddy]

Leave a Reply