Using rankmirrors script for faster Arch Linux package downloads

If you use Arch Linux I’d strongly suggest using the snippet of code below to use rankmirrors to sort your pacman repository mirrors into an optimal order, to use the fastest servers first.


cd /etc/pacman.d
for repo in *; do
echo "Processing $repo..."
mv $repo $repo.b4.rankmirrors
rankmirrors -v $repo.b4.rankmirrors > $repo
done

I was getting an average of about 300-400K/sec; after doing this, I was reaching 10M/sec!

5 thoughts on “Using rankmirrors script for faster Arch Linux package downloads”

  1. thanks! thats awesome! i got python to run rankmirrors… but wasn’t sure how to speet up the stuff. anyway, am i right that you just take that and put it in a script.sh and run it in a terminal?

    thnx

    sv

  2. @fred

    Glad you found it useful. You can put it in a shell script and run that, or if you want you can just run it directly (paste it into a terminal and it should do the trick).

    A worthwhile improvement would be to include a step that outputs the name of the repository being processed at the moment so you can see how it’s getting on – I’ll edit the post with that in a second.

  3. Excellent. Total newbie to Arch and this allowed me to update to KDE4.4, before I wasn’t getting the right mirrors.
    Nice one!

  4. Thank you for sharing this code. It definitely works! Helped me speed up our repository mirrors at the office.

Comments are closed.