How to: Find the fastest apt mirror server for Debian or Ubuntu
How to find the fastest apt Backup Server In Debian or Ubuntu
Submitted by ggarron on Wed, 05/14/2008-16:51
If you want to use the fastest mirror to download. 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 coshould be because not only the distance the server is from you but also the network congestion is a factor when talking about network speed.
When you want to download from the fastest image. when using the Deb file to upgrade or update your Debian system, you must understand that the server closest to you is not necessarily the fastest, because the network speed depends not only on the distance between you and the server, it also depends on network congestion.
For instance, your ISP may have a direct satellite connection to another country, and thus your nearest server shoshould be in that country, to avoid you the hassystemic to get that info, debian give you some tools, I will touch two of them here.
For example, if your ISP (Internet provider) may have a private satellite linked to another country, then the server closest to you may be in another country. To solve the problems you may encounter when obtaining this information, Debian provides some tools. Here we will first introduce two of them.
1.0 netselect-Apt
This tool will download the full list of mirrors and will quickly launch e throw them for the fastest mirror for you, the use of it really easy and reliable.
This will download the list of all images and quickly find the fastest image from them. The operation is very simple and reliable.
Installation
You just need to run:
For installation, enter:
Sudo aptitude install netselect-Apt
Running it
Once installed, run
Run the following command:
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.
Change Lenny to your version. you can replace it with the version name (for example, Lenny or Sid) or use the version to indicate the text: stable (stable version), testing (test version ), unstable (unstable version), experimental (trial version ).
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.
It will create a sources. list file in the current folder. You can copy the desired part to/etc/APT/sources. List, or replace the original file with this file.
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
As you can see, I use the-N and-S parameters, because I want to use apt-get to download non-open source software and Deb-Src (source code file)
2.0 apt-spy
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 e, you have to edit the mirrors_full file, while with APT-spy you just enter the countries you may want to have E for servers.
Apt-spy is a little more flexible than netselect-Apt. Perhaps, flexibility cannot accurately describe the difference. When you want to test a specific backup storage, netselect-apt requires you to enter the full name of the specific backup storage in the mirrors_full file, and apt-spy requires you to enter the country name.
Installation
To install it run:
For installation, enter:
Sudo aptitude install apt-spy
Running it
Run commands
You first need to get the mirrors file, and contrary to netselect-apt-spy does not do that automatically, so first run:
You must first download the image file, because apt-spy does not automatically download the image as netselcet-Apt. Therefore, first enter:
Sudo apt-spy update
Now it is time to run the tool:
Now you can use the apt-spy command:
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:
This is an available server in North America and Europe, if you want to create your own region, just add the region name like this in the/etc/apt-apy.conf file:
France-Germany-Netherlands:
FR
De
NL
France-Germany-Netherlands
The sources. List will be then copied to/etc/APT/sources. List. d/apt-spy.list
This sources. List will be 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.
Although apt-spy is a little longer than netselect-apt, it is not difficult to master and run
.
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.
PS: Remember that the Internet is changing all the time. This week, or today, the fastest image server tested is not necessarily the fastest in the future.