Skip to main content

Configure closest mirror with netselect-apt in Debian

Jose CerrejonLess than 1 minuteLinuxRaspberry PILinuxRaspberry PI

Configure closest mirror with netselect-apt in Debian


The default installation is configured to download the packages from a remote server that is sometimes saturated. The best thing is to call the closest mirror and that can be done with the netselect-apt package, which can be installed as usual:

sudo apt install -y netselect-apt

Now we invoke it with sudo netselect-apt version, where version is the version we currently have (jessie, stretch).

Notice that this solution does not support Raspbian, as it has its own mirrors and this application will not update your /etc/apt/sources.list. Although you can introduce it by hand. For Spain we could write:

# Comment the current mirror
sudo sed -i '/deb http:\/\/m/s/^/#/' /etc/apt/sources.list
# Add the Spain mirror to /etc/apt/sources.list
sudo sh -c 'echo "deb jessie main contrib non-free rpi" >> /etc/apt/sources.list'

I leave you the link with all the mirrors below.

Link: in new window