If you want to use the fastest mirror to download the .deb files you may need to upgrade or update your Debian machines, you have to remember that not always your nearest server is the fastest one, and that could be because not only the distance the server is from you but also the network congestion is a factor when talking about network speed.

For instance, your ISP may have a direct satellite connection to another country, and thus your nearest server should be in that country, to avoid you the hassle to get that info, Debian give you some tools, I will touch two of them here.


This tool will download the full list of mirrors and will quickly explore throw them for the fastest mirror for you, the use of it really easy and reliable.


You just need to run:

sudo aptitude install netselect-apt

Running it

Once installed, run

sudo netselect-apt -n -s lenny

Be sure to change lenny for your appropriate version, you can use the name of the version, (edge, lenny, sid) or the words stable, testing, unstable, experimental.

It will then write a sources.list file in the current directory, you may then copy that file to /etc/apt/sources.list or just edit and copy the lines you need from one to the other.

If you see, I have used -n and -s options, because I wanted to get the non-free section, and deb-src to be able to use apt-get source


apt-spy is a little bit more flexible, well maybe flexible is not the right word, as in netselect-apt you can also select some specific mirrors to explore, you have to edit the mirrors_full file, while with apt-spy you just enter the countries you may want to explore for servers.


To install it run:

sudo aptitude install apt-spy

Running it

You first need to get the mirrors file, and contrary to netselect-apt apt-spy does not do that automatically, so first run:

sudo apt-spy update

Now it is time to run the tool:

sudo apt-spy -a North-America -a Europe

To check for available servers in Noerth-America and Europe, if you want to create your own zone, just edit the file /etc/apt-spy.conf and add something like this:


The sources.list will be then copied to /etc/apt/sources.list.d/apt-spy.list

As you see, it is really easy to manage, it takes a little bit longer than netselect-apt to run, but also works well.

Note: Remember that during the week, or even the day not the same server is the fastest one for you, as conditions in the Internet change all the time.