LinuxCommandLibrary

reflector

Retrieve and filter Arch Linux mirror lists

TLDR

Sort by speed and save

$ sudo reflector --sort rate --save /etc/pacman.d/mirrorlist
copy
Get mirrors from country using HTTPS
$ reflector -c [Germany] -p https
copy
Get recently synced mirrors
$ reflector -l [10]
copy
Use config file
$ sudo reflector @/etc/xdg/reflector/reflector.conf
copy
Display help
$ reflector -h
copy

SYNOPSIS

reflector [-c country] [-p protocol] [-l num] [--sort method] [--save file]

DESCRIPTION

reflector retrieves and filters the latest Arch Linux mirrorlist. It can test mirror speed and sort by various criteria, then save an optimized mirrorlist for pacman.
The tool is useful for finding fast, reliable mirrors for your location. It can be run periodically via systemd timer to keep the mirrorlist current.

PARAMETERS

-c, --country _country_

Filter by country
-p, --protocol _proto_
Filter by protocol (http, https, ftp)
-l, --latest _num_
Get N most recently synced mirrors
--sort _method_
Sort by: rate, country, score, delay
--save _file_
Save output to file
--age _hours_
Only mirrors synced within N hours
-f, --fastest _num_
Return N fastest mirrors

CONFIGURATION

/etc/xdg/reflector/reflector.conf

Default configuration file with persistent options for country, protocol, sort method, and output path. Referenced with @ prefix on the command line.
reflector.service / reflector.timer
Systemd units for running reflector automatically on a schedule to keep the mirrorlist current.
/etc/pacman.d/mirrorlist
Output destination for the generated mirror list, used by pacman for package downloads.

CAVEATS

Arch Linux specific. Speed tests take time. Network conditions vary. Consider running periodically for best results. Requires internet access.

HISTORY

reflector was created for Arch Linux to automate mirror selection. It replaces manual editing of the mirrorlist with intelligent, automated selection based on speed and sync status.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community