Thursday, March 18, 2010

what to do when Arch repos are slow?

To change your mirror, open the file /etc/pacman.d/mirrorlist, uncomment a mirror near you, and move it to the top of the file.

rankmirrors will take a list of mirrors and arrange them in order of speed. If you want to find the 5 fastest mirrors where you are, pass it your mirrorlist with servers near you uncommented along with the "-n 5" option and redirect the output to a file, e.g.


cd /etc/pacman.d
cp mirrorlist mirrorlist.bak
rankmirrors -n 5 mirrorlist >mirrorlist

That will save a backup of your current mirrorlist to /etc/pacman.d/mirrorlist.bak and rank your mirrorlist file.

If you want to really increase pacman's speed, take a look at powerpill and reflector (the link is in my sig).

Reflector From ArchWiki

Reflector is a script which can be used to retrieve and filter the latest mirrorlist from the MirrorStatus page.

It can be obtained from the community repository:

# pacman -S reflector

Sample usage

First backup your mirrorlist:

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

The following command will filter the first 5 mirrors, sort them by speed and overwrite the file /etc/pacman.d/mirrorlist

# reflector -f 5 -r -o /etc/pacman.d/mirrorlist

For all available commands run

# reflector --help
Warning: Make sure the mirrorlist doesn't contain strange entries before syncing or updating with pacman.

1 comment:

Cardo Magna said...

the update command gives error:

# reflector -f 5 -r -o /etc/pacman.d/mirrorlist
usage: reflector [-h] [--connection-timeout n] [--list-countries]
[--cache-timeout n] [--save ]
[--sort {country,delay,age,rate,score}] [--threads n]
[--verbose] [-a n] [-c ] [-f n] [--grep ]
[-l n] [-n n] [-p ]
reflector: error: unrecognized arguments: -r -o /etc/pacman.d/mirrorlist
[root@alarmpi RPi.GPIO-0.4.1a]# reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist

The command from wiki instead has worked:
reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist

Blog Archive

About Me

Exclusion of liability Regarding StillStupid: The use you make of the guides, tips and downloads that you listed on this web site or on another website to which I refer is entirely at your own risk. In no way can I be held liable for damage or consequential damages of any kind, which occurs as a result of that use.