Arch Linux is still my favorite Linux distro for desktop use and once you get it
set up (which may take you a few tries, if it’s your first foray) it tends to be
pretty solid. That is, until you start seeing 404 error messages when you run
yay, or whatever your package manager du jour is.
These errors start to show up when you’re using a mirror that had went dark or is experiencing some intermittent issues.
Like all things Arch, there’s a package that can help you with this situation.
reflector and makes it extremely easy to update your mirror list.
It even has a
systemd script that can be setup to run automatically and keep
your mirror list up to date with the fastest servers based on your location.
To get started, you need to install the
sudo pacman -S reflector
Once installed, you may want to update the configuration to only use mirrors from your country. First, you’ll want to check the list of available countries:
I’m based in the US, so I want to use the
United States mirrors. Once you know
which country or countries you want to use, open the configuration file:
sudo vim /etc/xdg/reflector/reflector.conf
And add the line:
--country 'YOUR COUNTRY','OR COUNTRIES'
If so inclined, you can adjust any of the other configuration options as you see fit. Aside from adding in my country, I haven’t had any need to update anything else.
With everything configured, all we need to do is to enable and start the
reflector.timer services. The
update your mirror list on boot and gets triggered by the
automatically, once per week.
sudo systemctl enable reflector.service reflector.timer sudo systemctl start reflector.service reflector.timer
If you’re ever in the position that you need to update your mirror list right
this moment, you can run the
reflector.service to do so:
sudo systemctl start reflector.service
To check that things have run correctly, you can check out your
file which will have the date/time (in UTC) of the last time the file was