Arch Linux: reflector mirrorlist maintenance
I use Arch Linux, a simple, lightweight Linux distribution. You should, too. It’s not hard.
One of the things Arch users do is update, regularly.
I find that weekly updates are adequate.
Running sudo pacman -Syu every 7 to 10 days keeps problems away.
What happens when pacman updates fail, or updated package downloads get really slow?
I’ve been using Arch Linux since 2013 or so, on laptops and servers.
Every once in a while attempting a pacman update will give you
some confusing output.
I’ve seen pacman claim it can’t find one or more repository servers,
that a package version or even a whole package isn’t available,
or simply take too long to retrieve package files.
In those cases, one of the things you should try is updating the “mirror list”,
which is a file named /etc/pacman.d/mirrorlist.
At that point, the question becomes “Which of these many shiny repository servers should I use?”
You can get a decent customized mirror list with the Arch Linux reflector package.
% sudo pacman -Sy reflector
% cd /etc/pacman.d
% sudo reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist.x
% sudo mv mirrorlist mirrorlist.$(date -I)
% sudo mv mirrorlist.x mirrorlist
I reckon that in the case of a repo server not having any packages,
trying to install reflector is impossible,
so you should install it immediately.
Beyond getting a recommendation for reflector somewhere along the way,
my use of it may be entirely idiosyncratic.
I have not bothered to look to find out how others use it,
I figured this process out on my own.