2019-03-08 01:54 UTC
  • Xyne


Description: A Python 3 module and script to retrieve and filter the latest Pacman mirror list.
Latest Version: 2019.3
Source Code: src/
  • any
  • python3
Optional Dependencies:
  • rsync: rate rsync mirrors
Arch Repositories:
  • [community]
  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]
Arch Forum Thread: 115714


Reflector retrieves information from’s Mirror Status service via the JSON interface and filters servers based on user options to generate Pacman mirrorlists. Please see reflector --help for details.


Thanks to Pierre for creating the previous MirrorStatus interface for Reflector on

Help Message

$ reflector --help

usage: [-h] [--connection-timeout n] [--list-countries]
                    [--cache-timeout n] [--save <filepath>]
                    [--sort {age,rate,country,score,delay}] [--threads n]
                    [--verbose] [--info] [-a n] [-c <country>] [-f n]
                    [-i <regex>] [-x <regex>] [-l n] [--score n] [-n n]
                    [-p <protocol>] [--completion-percent [0-100]] [--isos]
                    [--ipv4] [--ipv6]

retrieve and filter a list of the latest Arch Linux mirrors

optional arguments:
  -h, --help            show this help message and exit
  --connection-timeout n
                        The number of seconds to wait before a connection
                        times out. Default: 5
  --list-countries      Display a table of the distribution of servers by
  --cache-timeout n     The cache timeout in seconds for the data retrieved
                        from the Arch Linux Mirror Status API. The default is
  --save <filepath>     Save the mirrorlist to the given path.
  --sort {age,rate,country,score,delay}
                        Sort the mirrorlist. "age": last server
                        synchronization; "rate": download rate; "country":
                        server's location; "score": MirrorStatus score;
                        "delay": MirrorStatus delay.
  --threads n           The maximum number of threads to use when rating
                        mirrors. Default: 5
  --verbose             Print extra information to STDERR. Only works with
                        some options.
  --info                Print mirror information instead of a mirror list.
                        Filter options apply.

  The following filters are inclusive, i.e. the returned list will only
  contain mirrors for which all of the given conditions are met.

  -a n, --age n         Only return mirrors that have synchronized in the last
                        n hours. n may be an integer or a decimal number.
  -c <country>, --country <country>
                        Match one of the given countries (case-sensitive). Use
                        "--list-countries" to see which are available.
  -f n, --fastest n     Return the n fastest mirrors that meet the other
                        criteria. Do not use this option without other
                        filtering options.
  -i <regex>, --include <regex>
                        Include servers that match <regex>, where <regex> is a
                        Python regular express.
  -x <regex>, --exclude <regex>
                        Exclude servers that match <regex>, where <regex> is a
                        Python regular express.
  -l n, --latest n      Limit the list to the n most recently synchronized
  --score n             Limit the list to the n servers with the highest
  -n n, --number n      Return at most n mirrors.
  -p <protocol>, --protocol <protocol>
                        Match one of the given protocols, e.g. "http", "ftp".
  --completion-percent [0-100]
                        Set the minimum completion percent for the returned
                        mirrors. Check the mirrorstatus webpage for the
                        meaning of this parameter. Default value: 100.0.
  --isos                Only return mirrors that host ISOs.
  --ipv4                Only return mirrors that support IPv4.
  --ipv6                Only return mirrors that support IPv6.



  • Refactored code to make it more modular. The MirrorStatus class remains with all of its functions for backwards compatibility but this will either be removed for further refactored in the future.
  • Added --isos, --ipv4 and --ipv6 options.


  • Added --score option.
  • Remove old-style message formatting.
  • Use logging module instead of custom methods.


  • case-insensitive country name matching


  • added --info option for displaying info about each mirror
  • added support for filtering by country code


  • added code to time rsync downloads (suggested by Teo Guo Ci, implemented with a slightly different approach)
  • get_mirrorlist method now accepts an unquoted command list.
  • updated string formatting commands (e.g. 'foo %s %s' % (x, y) to 'foo {} {}'.format(x, y))
  • changed format of generated mirrorlist header
  • fixed help message for --verbose (STDOUT -> STDERR)


  • added --include and --exclude filter options
  • removed --grep option (replaced by --include)


  • added JSON data caching to avoid redundant connections to
  • added --connection-timeout and --cache-timeout options


  • added “delay” and “score” to sort options


  • rewritten in Python 3 following the deprecation of the perl-xyne-arch package
echo | sed 's/\./@/'
Blog News
XHTML 1.0 Strict CSS level 3 Atom 1.0