pacman-mirrorup is a program to retrieve the best and latest Pacman mirror list based on user’s geography.
pacman-mirrorup uses JSON from Arch Linux’s mirror status as data source. It applies filters as the following to original data:
-
Only active mirror
-
HTTP/HTTPS protocol
-
Completion at 100 percent
-
Age under one hour
To take user’s geography into consideration.
All filtered mirrors are tested data transfer rate.
The mirror’s score from original data is weighted using transfer rate.
In other words, mirror’s score is refined by using user’s download speed.
Finally, the best N mirrors are selected.
The best N mirrors can be changed by --mirror
option, the default is 10.
The total number of synced mirrors to be tested is 100.
This number can be changed by --max-check
option.
To exclude a specific mirror, use --exclude
option.
This command line option can be specified many times.
$ pacman-mirrorup \
--exclude <A-DOMAIN-NAME> \
--exclude domain=<A-DOMAIN-NAME> \
--exclude country=<A-COUNTRY-NAME> \
--exclude country_code=<A-COUNTRY-CODE>
The excluded mirror list could also be loaded from a file using --exclude-from <FILE>
option.
Format is one excluded pattern per line.
Any pattern with prefix !
is a negated pattern;
any matching mirror excluded by a previous pattern will become included again.
The excluded list from --exclude
option take precedence over list from --exclude-from
option.
The later occurrence of excluded pattern in list will also override any previous rules.
For example:
# This is a comment.
ban.this.mirror
; This is a comment too.
domain = ban.this-mirror.also
# Without `domain =`
ban.this.mirror
# Filter by country name
country = SomeCountry
# Filter by country code
country_code = SC
# Include this mirror, even though it was banned by previous rules
!domain = mirror.in.SomeCountry
It is available on AUR as pacman-mirrorup. To build and install arch package from GIT source:
$ git clone https://github.com/bpetlert/pacman-mirrorup.git
$ cd pacman-mirrorup
$ makepkg -p PKGBUILD.local
$ pacman -U pacman-mirrorup-xxxx-1-x86_64.pkg.tar
pacman-mirrorup can also be used directly from console.
Without --output-file
option, pacman-mirrorup will display output on STDOUT.
pacman-mirrorup provides systemd timer unit which can be enabled by
$ systemctl enable --now pacman-mirrorup.timer
To change the options of pacman-mirrorup service, run systemctl edit pacman-mirrorup.service
[Service]
Environment='MIRRORUP_ARGS=--output-file /etc/pacman.d/mirrorlist --threads 10'
To show log message higher than waning try set RUST_LOG
environment variable. For example:
[Service]
Environment='RUST_LOG=pacman_mirrorup=debug'
Environment='MIRRORUP_ARGS=--output-file /etc/pacman.d/mirrorlist --threads 10'
To change the options of pacman-mirrorup timer, run systemctl edit pacman-mirrorup.timer
[Timer]
OnCalendar=
OnCalendar=daily