formats

Select Fastest Debian Mirror for apt-get

Published on May 15, 2011, by + in linux, sysadmin.




With Debian you can easily auto-detect the fastest mirror for apt-get!




First install this package:

$ sudo apt-get install netselect-apt

Then run the following, adjusting for your desired version. I’m using LMDE, so I’m going to run:

$ sudo netselect-apt testing

Other examples:

sudo netselect-apt [stable|testing|unstable|experimental|release_codename|sid]

01netselect

02netselect

This will query various debian mirrors then leave a file sources.list in your current working directory.

03netselect




You can now manually update your /etc/apt/sources.list with the fastest mirror found for your system.

$ sudo nano /etc/apt/sources.list

Only replace the existing line

deb http://[___]debian.org/debian stable main contrib

with your new mirror. Leave others such as security.debian.org and third party repos as they are.

04netselect

Sweet!

6 Responses

  1. gavin

    Do you know how I could do the same on Ubuntu? I cannot seem to install it:

    $ sudo apt-get install netselect-apt
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package netselect-apt is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘netselect-apt’ has no installation candidate

    • Mascha Xenos

      Download the source from a http:// repo and compile the tool on ubuntu.
      Many good debian-tools are not available in ubuntu since they are replaced by tools from the ubuntu-repo or just not done for ubuntu (yet).
      But I just thought, that I read somewhere, that a similar tool is available… still don’t remember the name.

      Maybe google helps, too ;)

  2. sh4

    Scott did you know that you can rename (or remove) the current sources.list before running the netselect?

    $ sudo mv /etc/apt/sources.list /etc/apt/sources.bak
    $ sudo netselect-apt sid

    Way long easier!

    Greets

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Home linux Select Fastest Debian Mirror for apt-get