Fastest (and upto date) pacman mirrors.

We’ve all faced this problem sometime or the other : Installing/upgrading packages takes forever because the pacman mirrors are slow.
Thankfully, as always, the Arch wiki and pacman have us covered. Pacman itself comes with a bash script which is at

/usr/bin/rankmirrors

. This script ranks mirrors according to their connection and opening speeds.
First make a backup of your existing mirrorlist.

# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup

Edit the mirrorlist and uncomment all mirrors for testing.

# sed -i 's/^# Server/Server/' /etc/pacman.d/mirrorlist.backup

Finally rank the mirrors. The ‘6’ below outputs the 6 fastest mirrors.

# rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist

Note that it is good practice now to run the following.

# pacman -Syyu

This forces a redownload of the package lists and upgrades the packages. Passing two
–refresh or -y flags will force a refresh of all package lists even if they appear to be up to date.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s