What are mirrors and why are they important?
Mirrors are the package servers we use when installing or updating packages. There are lots of mirrors (for Arch) around the world, and to keep package updates running smoothly, the mirrors should be both:
- fast (high data rate and responsiveness)
- up to date
On an EndeavourOS system, Arch mirror addresses are gathered as a list into file /etc/pacman.d/mirrorlist.
In the /etc/pacman.d/mirrorlist file, lines that begin with a # are ignored, and then the order (from top to bottom) is respected. If a problem exists with the first entry, pacman defaults to using the next active line down.
Usually (but not always) the closest mirrors are the fastest. That’s why we usually want to use mirrors from the user’s current location (country) or some nearby countries.
Another important factor is that the mirrors we use are up to date, meaning they have been synced with the master Arch package server recently. Better to use a mirror that has the latest Arch packages.
Yet another (temporary) concern may be that a particular mirror is offline, e.g. under maintenance. Sometimes a mirror may even be permanently offline.
That’s why having a decent list of mirrors on your machine is important.
Note that the list of mirrors can (and usually should) be ranked to get the best experience when updating or installing packages. Ranking mirrors organizes the list of mirrors so that the best mirrors for your location are at the beginning of the list.
What about EndeavourOS mirrors?
EndeavourOS has its own packages as well, thus EndeavourOS has its own list of mirrors and you can find the mirror list is in file /etc/pacman.d/endeavouros-mirrorlist.
To be able to rank EndeavourOS mirrors, first you need to install
eos-rankmirrors package if not already installed.
yay -S --needed eos-rankmirrors
EndeavourOS mirrors can now be ranked with a terminal command (note: call without sudo!)
It fetches the latest EndeavourOS mirrorlist from the EndeavourOS development site, and ranks the mirrors found in that list. Then it shows you the ranking result, and prepares to write the ranked list to file /etc/pacman.d/endeavouros-mirrorlist. For writing the file it needs elevated privileges, and asks you the required password.
By default, eos-rankmirrors uses the
pkexec command when more privileges are needed. If you have configured variable
EOS_ROOTER (in file /etc/eos-script-lib-yad.conf), that command will be used instead of the default.