Tuxtips - Linux HowTos

Linux HowTos live here


How to refresh Arch repository mirrors

28 Jul 2020

Arch Linux has a wide network of mirror servers for its repository and it is a good practice to choose the ones that are close to your location, so that the upgrades you perform (at least you should) regularly are smooth and problem-free. It may happen that your local mirror has some issues and it is necessary to change it to some other server.

Obviously you may do it manually, making the appropriate changes in the /etc/pacman.d/mirrorlist file, but there is a much more convenient way. First, you may need to install the reflector package

click code to copy
sudo pacman -S reflector

and once it's installed, you can use it to change your mirrorlist so that it includes the servers that give the best performance in your location. You need to tell reflector where to look for them - just specify the country you are in and some neighbors:

click code to copy
sudo reflector --country Country1 --country Country2 --country Country3 --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

Of course you need to change Country1, Country2, and Country3 into the names of the countries you want to specify. You may want to list as many or as few countries as you like.

It is worth learning about various reflector options adding --help to the reflector command:
click code to copy
sudo reflector --help

You will then learn how the particular options work.
Tested on: EndeavourOS, July 2020.
Comments Add your comment




Enter the digit "eight" (spam protection):

westandskif3 years ago
You could try https://github.com/westandskif/rate-arch-mirrors
I built it after using reflector for a while.
Reply





Enter the digit "eight" (spam protection):

website for sale
This website is for sale! Click here.
I use a secure and private e-mail service.
Why don't you try it?