Generate Mirrorlist on Manjaro | Arch Linux based on Country

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.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Autofs also referred to as automount is a feature in Linux like systems that automatically mount filesystems on demand. In […]

Every Linux user must be familiar with the command ‘man’. The command is used to display instructions on the usage […]

Engineering is a science-math problem solving field in our society. Engineers make use of engineering skills to convert ideas in […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.