Ubuntu apt-get select best server using apt-get mirrors

Occasionally I’m faced with slow downloads from Ubuntu main repository server. A quick way around this will be to add mirror urls below to your apt-get sources list file found at $ sudo vim /etc/apt/sources.list.

Remember to remove all entries before you add the mirror sites shown below.

Replace precise with name of your distribution, which you can get using the command $ sudo lsb_release -a

deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

Leave a comment