Arch Linux | Reflector
-
One of the things that I have found that can be annoying with Arch is that if you aren’t updating the OS on a regular basis, you will run into not being able to due the updates because the mirrorlist will be out of date. The easiest way to circumvent this is to update Arch using
sudo pacman -Syuweekly/bi-weekly.Another option is to install Reflector and enable and start the service so it can run on boot it is hooked into pacman when you run it. I am not sure if this would be a problem if you are using Arch as a daily driver and updating through the Software Center.
This installs Reflector
sudo pacman -S reflectorThis starts Reflector service
sudo systemctl start reflectorThis allows Reflector service to start at boot
sudo systemctl enable reflectorThis allows you to check on the status of Reflector
sudo systemctl status reflector -
undefined Madchatthew marked this topic as a regular topic on
-
I would like to add that if you type
reflector --helpin the console you can see the different options you can add to the configuration file. I changed the sort to rate, so the fastest mirrors get used first. I also changed my country to US, because that is where I live and everything else I left default. While doing some research, the Reflector service should fire up about once a week or at boot. It is hooked into pacman so it may refresh when you run the update command above.Location of the config file:
/etc/xdg/reflector/reflector.conf -
I don’t know how I missed this, but I found out that there is a
reflector.serviceand areflector.timerservice that should both be enabled and started. My understanding is that if you enable and start the reflector.timer service, that it will trigger the reflector.service to update the mirror list. I wanted to make sure I was covered either way and enabled and started them both. The commands are below to do this.sudo systemctl enable --now reflector.servicesudo systemctl enable --now reflector.timerOf course you can find the source material here: https://wiki.archlinux.org/title/Reflector
-
I have another update for reflector that I just figured out.
You will want to edit the following file and add details to make sure that every time it updates the mirror list, it is grabbing them from your country and I grab 10 and sort them by rate. This will ensure that your mirrorlist isn’t getting populated with links from other countries which can slow down you downloads.
sudo nano /etc/xdg/reflector/reflector.confThis is what the file looks like.
# Reflector configuration file for the systemd service. # # Empty lines and lines beginning with "#" are ignored. All other lines should # contain valid reflector command-line arguments. The lines are parsed with # Python's shlex modules so standard shell syntax should work. All arguments are # collected into a single argument list. # # See "reflector --help" for details. # Recommended Options # Set the output path where the mirrorlist will be saved (--save). --save /etc/pacman.d/mirrorlist # Select the transfer protocol (--protocol). --protocol https # Select the country (--country). # Consult the list of available countries with "reflector --list-countries" and # select the countries nearest to you or the ones that you trust. For example: --country US # Use only the most recently synchronized mirrors (--latest). --latest 10 # Sort the mirrors by synchronization time (--sort). --sort rateHere are the different flag options that you can change or add to this file. I found this on google by searching
arch linux reflector flags.Filtering Options (What to find) --country <CODE/Name>: Selects mirrors from specific countries (e.g., US, France,Germany). Use {Link: reflector --list-countries https://archlinux.org/mirrors/status/}, for a full list. --protocol <http|https>: Filters for HTTP or HTTPS mirrors. --age <hours>: Only includes mirrors synced within the last X hours (e.g., --age 12). --delay <hours>: Limits to mirrors with a reported sync delay of X hours or less (e.g., --delay 0.25 for 15 mins). --latest <N>: Limits results to the top N newest mirrors. Sorting Options (How to order) --sort rate: Sorts by download speed (requires testing, can be slow). --sort age: Sorts by most recently synced. --sort score: Sorts by overall score. --sort country: Sorts by country, useful with multiple countries. Output Options (Where to put it) --save <path>: Writes the filtered/sorted list to a file (e.g., /etc/pacman.d/mirrorlist). --verbose or -v: Shows detailed progress and mirror info.
Related Topics
-
-
-
-
-
-
-
-
SASL LOGIN authentication failed: generic failure
Moved Solved Linux