November, 2017
pacman-mirrors - generate pacman mirrorlist for Manjaro Linux
pacman-mirrors [-f[NUMBER] [[-i[-d]] [-cCOUNTRY[[,COUNTRY]…]|–geoip]]] [-a[-pPREFIX][-R][-G|-B/-SBRANCH][-PPROTO[[,PROTO]…]][-UURL]] [-bBRANCH] [-q] [-tSECONDS] [-v] [-n]
Generates mirrorlist with up-to-date mirrors for Manjaro Linux.
Default is to rank all mirrors by reponse time.
If no arguments are given pacman-mirrors lists available options.
Pacman-mirrors requires access to files which are read-only so it must be run with su or sudo.
To create a mirrorlist using all default use
pacman-mirrors -f
The mirrorlist generation process can be refined through arguments and arguments with options, for example
pacman-mirrors --country Denmark --timeout 5
After all operations ALWAYS syncronize your pacman database with
sudo pacman -Syy
No matter how you choose to generate your mirrorlist, you will ONLY get up-to-date mirrors. This means the - at any given time - number available mirrors will vary depending on when the mirror last syncronized with the master repo server.
/etc/pacman-mirrors.conf
/etc/pacman.d/mirrorlist
pacman
uses to update your system./usr/share/pacman-mirrors/mirrors.json
/var/lib/pacman-mirrors/status.json
/var/lib/pacman-mirrors/custom-mirrors.json
-i/--interactive [-d/--default]
argument or the -c/--country
argument.If you are stunned by this message
.: WARNING No mirrors in selection
.: INFO The mirrors has not changed
This is not an error, it is a feature.
The reason: You have limited your mirror pool too much and none of your selected mirrors are up-to-date.
Suggested solutions:
--geoip
pacman-mirrors -c all -aP all
and then pacman-mirrors -f
**Some options are mutual exclusive and will throw an arguments error:
Some arguments requires another argument present to have effect. E.g., this command will ignore –default argument
WRONG
pacman-mirrors -b unstable --default
The -d/–default argument tells -i/–interactive to force load all mirrors from the mirrorfile
CORRECT
pacman-mirrors -b unstable --interactive --default
Or
pacman-mirrors -bunstable -id
API specific arguments. For those to have effect the -a/–api argument must be present.
pacman-mirrors -aS unstable
The arguments can appear in any order except for arguments which takes additional options in which case the options must follow immediately after the argument with or without space, for example
pacman-mirrors -f
pacman-mirrors -f 5
pacman-mirrors -f5
Pacman-mirrors always attempt to download the lastest available data from http://repo.manjaro.org. These data is always used during mirrorlist generation to ensure that you connect to a mirror which is up-to-date for your selected branch. Should you decide to temporarily switch branches you will still connect to an up-to-date mirror.
0 : OK
1 : Problem with argument
2 : Problem accessing systemfiles
3 : Missing mirror file
BRANCH: Value from config
At launch an internal default configuration is setup, file configuration is applied and the commandline is parsed and applied.
These arguments modifies key elements of pacman-mirrors configuration according to the packagers needs.
The actions performed by the API are in strict order and performed before any other actions. This also means that ordinary arguments supplied in conjunction with api might be ignored. Eg. -U argument terminates pacman-mirrors when branch and mirrorlist has been written.
When done pacman-mirrors checks the internet connection and if possible download the latest datafiles for creating the mirrorlist. At this point it is possible to interrupt further processing.
If the -n/–no-mirrorlist argument is present pacman-mirrors will now exit.
Most optional arguments are self explaining others require explanation. The API functions is mainly designed to help packagers and iso-builders. However it can be of use for everyone because it takes the hazzle out of editing your pacman-mirrors configuration.
Which countries has mirrors?
pacman-mirrors -l
What branch am I on
pacman-mirrors -aG
I want to temporary change branch to unstable, use geolocation,
sudo pacman-mirrors -b unstable –geoip
I want to permanently change branch to unstable, use mirrors from Germany and France, use only https and http protocol in that order
sudo pacman-mirrors -ac Germany,France -S unstable -P https http
Create a mirrorlist with German mirrors
sudo pacman-mirrors -c Germany
If you want more countries in your mirrorlist add them
sudo pacman-mirrors -c Germany France Denmark
Create a mirrorlist with 5 mirrors up-to-date on your branch
sudo pacman-mirrors -f 5
I want to choose my mirrors
sudo pacman-mirrors -i
I have a custom mirror list and I want to create a new custom mirror list?
sudo pacman-mirrors -i –default
I have a custom mirror list - can I reset it?
sudo pacman-mirrors -c all
Change system branch and dont change the mirrorlist
sudo pacman-mirrors -naS unstable
Change system branch and replace branch in mirrorlist and quit
sudo pacman-mirrors -naRS unstable
Change protocols you will accept but dont touch the mirrorlist
sudo pacman-mirrors -naP https http
A packager can write directly to a mounted systems datafiles using either a path or an environment variable replacing the branch in both configuration and mirrorlist leaving the mirrors as is
sudo pacman-mirrors -anR -p $prefix -S $branch -P https
It is also possible to specify a mirror in which case the mirrorlist is created and pacman-mirrors terminate
sudo pacman-mirrors -ap $prefix -S $branch -U $url
https://github.com/manjaro/pacman-mirrors/issues
The pacman-mirrors source code and all documentation may be downloaded from https://github.com/manjaro/pacman-mirrors/archive/master.zip
Esclapion <esclapion@manjaro.org>
philm <philm@manjaro.org>
Ramon Buldó <rbuldo@gmail.com>
Hugo Posnic <huluti@manjaro.org>
Frede Hundewadt <echo ZmhAbWFuamFyby5vcmcK | base64 -d>