Keep Your Arch Linux Mirrors Fast With Reflector
Install and configure reflector to automatically keep your Arch Linux mirrorlist sorted by speed, with a systemd timer — no manual maintenance needed.
Introduction
If you've been running Arch Linux for a while, you've probably noticed that pacman -Syu can feel sluggish sometimes — or worse, fail entirely with timeout errors. The culprit is often your mirrorlist: the servers it points to may have gone stale, fallen out of sync, or simply be too far away from you geographically.
Arch doesn't automatically update your mirrorlist. The file at /etc/pacman.d/mirrorlist is generated once during installation and never touched again — unless you do it yourself. Over time, mirrors drift: some go offline, others fall behind on syncing, and faster ones appear that your list doesn't know about.
That's where reflector comes in.
What is Reflector?
Reflector is an official Arch Linux utility that queries the Arch Mirror Status page, filters mirrors based on criteria you define (protocol, country, sync freshness, speed), and writes a clean, optimized mirrorlist.
Instead of manually editing /etc/pacman.d/mirrorlist or copy-pasting from the Arch website, you run a single command and get a mirrorlist tailored to your needs. Even better, you can automate it with systemd so it stays fresh without any manual intervention.
Installation
Reflector is available in the official repositories:
sudo pacman -S reflectorThat's it. The package also ships with a systemd service and timer, ready to be enabled.
Configuration
Reflector's configuration lives at /etc/xdg/reflector/reflector.conf. This file is used by both the CLI and the systemd service. Here's what I use:
--save /etc/pacman.d/mirrorlist
--protocol https
--country France,Germany,Thailand,Singapore,Japan
--latest 5
--sort rateLet's break down each option:
--save /etc/pacman.d/mirrorlist— writes the output directly to pacman's mirrorlist file--protocol https— only selects HTTPS mirrors for secure downloads--country France,Germany,Thailand,Singapore,Japan— limits candidates to mirrors in these countries. Runreflector --list-countriesto see all available options--latest 5— only considers the 5 most recently synchronized mirrors--sort rate— sorts results by download speed, fastest first
Why --sort rate with multiple regions? Reflector doesn't detect your geolocation — it generates a static mirrorlist. But by listing countries from different parts of the world and sorting by download speed, you get location-aware behavior for free: each time the timer runs, reflector benchmarks every candidate mirror and the closest ones naturally end up on top. Move from Europe to Asia, wait for the next timer run, and your mirrorlist adapts automatically.You can test your configuration without overwriting the mirrorlist by running reflector manually:
reflector --protocol https --country France,Germany,Thailand,Singapore,Japan --latest 5 --sort rateThis prints the resulting mirrorlist to stdout so you can review it before applying.
Automating With systemd
Running reflector manually works, but the whole point is to set it and forget it. The package ships with two systemd units:
reflector.service— runs reflector once, reading options from/etc/xdg/reflector/reflector.confreflector.timer— triggers the service on a recurring schedule
Enable the timer:
sudo systemctl enable --now reflector.timerBy default, the timer runs weekly. You can inspect the schedule with:
systemctl cat reflector.timerIf weekly is too infrequent (or too frequent) for your taste, create an override:
sudo systemctl edit reflector.timerThen set your preferred schedule:
[Timer]
OnCalendar=
OnCalendar=dailyThe first OnCalendar= line clears the default value; the second sets the new one. You can use any valid systemd calendar expression — weekly, monthly, *-*-01,15 04:00:00 (twice a month at 4 AM), etc.
Verify that the timer is active and check when it will fire next:
systemctl list-timers reflector.timerRunning It Once Right Now
If you just installed reflector and want to update your mirrorlist immediately without waiting for the timer:
sudo systemctl start reflector.serviceOr run it directly from the config file:
sudo reflector @/etc/xdg/reflector/reflector.confThen verify the result:
head -20 /etc/pacman.d/mirrorlistYou should see a handful of HTTPS mirrors from your selected countries, sorted by download speed.
Conclusion
Reflector solves a small but real annoyance on Arch Linux: keeping your pacman mirrors current. Five minutes of setup — install the package, edit the config, enable the timer — and you never have to think about it again. Your pacman -Syu will consistently hit fast, up-to-date mirrors without any manual maintenance — even if you change countries.