Video failed to load

Reflector for Arch Linux

Reflector for Arch Linux
312 words
2 minutes
Reflector for Arch Linux
AI Usage

Some of these article contents are derived from Google Gemini.

What is reflector?#

reflector is a Python script that can retrieve the latest mirror list from the Arch Linux Mirror Status page, filter the most up-to-date mirrors, sort them by speed and overwrite the file /etc/pacman.d/mirrorlist.1

INFO

If your main concern is download speed, pacman’s default mirrorlist should be enough, as the first (prioritized) entries are worldwide locations, which automatically pick a content delivery network (CDN) server close to your location to provide fast download speeds.

Exclusivity

Currently, reflector is available only in archlinux.

Installation#

Terminal window
sudo pacman -Sy reflector

Usage#

WARNING

Running reflector leads to the overwrittance of /etc/pacman.d/mirrorlist file. So, it’s always a good idea to back it up before everything else:

Terminal window
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak

Run:

Terminal window
reflector --help

to see its available options.
These are the common used ones:2

  • --save <path>: Write the resulting mirror list to a specified file (usually /etc/pacman.d/mirrorlist).
  • --country <country>: Filter mirrors by country name or ISO 2-letter country code (e.g., United States, Germany, ID).
  • --protocol <protocol>: Filter mirrors by protocol type, such as https or http.
  • --latest <number>: Select the specified number of the most recently synchronized mirrors (-l).
  • --fastest <number>: Select the specified number of the fastest mirrors (-f).
  • --sort <criteria>: Sort the filtered mirrors by rate (download speed), score, age, or country.
  • --verbose: Show detailed progress and status output (-v).
  • --download-timeout <seconds>: Set a custom timeout for mirror speed tests (default is usually 5 seconds).

Preview mirrors without saving#

Terminal window
reflector --latest 20 --sort rate --fastest 10

Fetch the fastest HTTPS mirrors#

Terminal window
sudo reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

Filter by country and protocol#

Terminal window
sudo reflector --country "Indonesia" --protocol rsync --latest 30 --sort rate --save /etc/pacman.d/mirrorlist

Automation (reflector-timer)#

You can automate Reflector to update your mirrorlist periodically in the background using systemd units.1

1. Configure default options#

Edit /etc/xdg/reflector/reflector.conf to specify your preferred flags (like --country, --protocol, --sort rate, and --save).

2. Enable and start the timer#

Terminal window
sudo systemctl enable --now reflector.timer

3. Check timer status#

Terminal window
systemctl list-timers

4. Run and immediate update manually#

Terminal window
sudo systemctl start reflector.service

Footnotes#

  1. https://wiki.archlinux.org/title/Reflector ↩ ↩2

  2. https://gemini.google.com ↩

Support & Share

If this article helped you, please share or support!

Sponsor
Reflector for Arch Linux
https://secretblog.my.id/posts/tech/reflector/
Author
Wildan
Published at
2026-10-22

Comments

Profile Image of the Author
Wildan
🐧 Linux Enthusiast
Greetings
You've found out my secret blog?! Welcome to my blog, then! Enjoy exploring 😄
Categories
Tags
Latest Moments
Site Statistics
Posts
118
Categories
97
Tags
340
Total Words
625,871
Running Days
0 days
Last Activity
0 days ago
Site Info
Build Platform
GitHub Actions
Blog Version
Firefly v6.16.9
License
CC BY-NC-SA 4.0
Quote of The Day ✨
"It always seems impossible until it's done."
—— Nelson Mandela
 
--%
– days left this year
--%
– days left this month
--%
– days left this week
--%
– hours left today
Table of Contents