How can I generate repository mirrors on Manjaro and Arch Linux based on my Country? Every time you’re downloading packages on Arch Linux and Manjaro, pacman uses the mirrors in the order they are listed in /etc/pacman.d/mirrorlist
.
Since the priority of the mirrors is based on the order they appear in the list it is recommended to always choose mirrors close to you for better speeds. One of the metric you can use for this is selecting mirrors based on geographical location, starting from your local country.
The official Arch Linux mirror list is available from the pacman-mirrorlist package. If not present you can install with the command below.
sudo pacman -S pacman-mirrorlist

When the package is installed it will provide pacman-mirrors command line tool used to generate pacman mirrorlist for Arch and Manjaro Linux.
pacman-mirrors --help
It will generate mirrorlist with up-to-date mirrors ranked all by average response time.
Generate Country Specific Mirrorlist on Manjaro | Arch Linux
Run the following command to list available countries:
pacman-mirrors -l

To generate mirrorlist using Country the syntax is:
sudo pacman-mirrors -c, --country COUNTRY [COUNTRY ...]
For multiple countries separate the list with comma.
As I’m based in Kenya, the command I’ll run is:
$ sudo pacman-mirrors -c Kenya
[sudo] password for cloudspinx:
::INFO Downloading mirrors from Manjaro
::INFO => Mirror pool: https://repo.manjaro.org/mirrors.json
::INFO => Mirror status: https://repo.manjaro.org/status.json
::INFO User generated mirror list
::------------------------------------------------------------
::INFO Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
::INFO Using default mirror file
::INFO Querying mirrors - This may take some time
0.578 Kenya : https://manjaro.mirror.liquidtelecom.com/
::INFO Writing mirror list
::Kenya : https://manjaro.mirror.liquidtelecom.com/stable
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
Confirm the mirrorlist file contents.
$ cat /etc/pacman.d/mirrorlist
##
## Manjaro Linux custom mirrorlist
## Generated on 2022-12-02 21:14
##
## Please use 'pacman-mirrors -id' To reset custom mirrorlist
## Please use 'pacman-mirrors -c all' To reset custom mirrorlist
## To remove custom config run 'pacman-mirrors -c all'
##
## Country : Kenya
Server = https://manjaro.mirror.liquidtelecom.com/stable/$repo/$arch
Specifying multiple countries
The other country in Africa listed is South Africa so I can use the two countries for better availability using the command:
$ sudo pacman-mirrors -c Kenya,South_Africa
::INFO Downloading mirrors from Manjaro
::INFO => Mirror pool: https://repo.manjaro.org/mirrors.json
::INFO => Mirror status: https://repo.manjaro.org/status.json
::INFO User generated mirror list
::------------------------------------------------------------
::INFO Custom mirror file saved: /var/lib/pacman-mirrors/custom-mirrors.json
::INFO Using custom mirror file
::INFO Querying mirrors - This may take some time
0.109 Kenya : https://manjaro.mirror.liquidtelecom.com/
0.665 South_Africa : http://mirror.is.co.za/mirrors/manjaro.org/
::INFO Writing mirror list
::Kenya : https://manjaro.mirror.liquidtelecom.com/stable/$repo/$arch
::South_Africa : http://mirror.is.co.za/mirrors/manjaro.org/stable/$repo/$arch
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist
::INFO To reset custom mirrorlist 'sudo pacman-mirrors -id'
::INFO To remove custom config run 'sudo pacman-mirrors -c all'
Check mirrorlist file contents.
$ cat /etc/pacman.d/mirrorlist
##
## Manjaro Linux custom mirrorlist
## Generated on 2025-05-02 12:04
##
## Please use 'pacman-mirrors -id' To reset custom mirrorlist
## Please use 'pacman-mirrors -c all' To reset custom mirrorlist
## To remove custom config run 'pacman-mirrors -c all'
##
## Country : Kenya
Server = https://manjaro.mirror.liquidtelecom.com/stable/$repo/$arch
## Country : South_Africa
Server = http://mirror.is.co.za/mirrors/manjaro.org/stable/$repo/$arch
After all operations it is always a recommendation to syncronize and update your system with:
sudo pacman -Syyu
Accept upgrades by pressing the y key in your keyboard:
...
Total Download Size: 2110.63 MiB
Total Installed Size: 6729.67 MiB
Net Upgrade Size: 351.75 MiB
:: Proceed with installation? [Y/n] y
You should notice faster download speeds when doing package installations on Manjaro and any other Arch based Linux distribution you’re running. Also check other articles available in our website.