Custom mirrors (pacman-mirrors) and pamac

Hello dear Manjaro community, I need advice on how to properly configure Manjaro mirrors. I currently have my country selected in Pamac, but here are only two mirrors. I’d like to add more countries in my region.

I’ve searched forums and wikis, but I haven’t found a clear explanation, or at least I haven’t understood it well.

I tried doing this a while ago using pacman-mirrors:


sudo pacman-mirrors -c Spain,France,Netherlands,Germany,Italy,Sweden,Czech_Republic,United_States

but Pamac’s scheduled task to automatically update them rewrote them with only the mirrors for my country. Is there a way to configure this without Pamac rewriting them?

Would be this due to not issuing sudo pacman -Syu after setting the mirrors with pacman-mirrors?

I know that I would disable the Pamac timer with:

sudo systemctl disable pamac-mirrorlist.timer --now
sudo systemctl mask pamac-mirrorlist.timer

But I do not want changing this, if possible.

Thank you very much.

Simply override pamac-mirrorlist.service with your command sudo systemctl edit pamac-mirrorlist.service and add this line:

ExecStart=/usr/bin/pacman-mirrors -c Spain,France,Netherlands,Germany,Italy,Sweden,Czech_Republic,United_States

And you can keep timer enabled after this :wink:

3 Likes

Thank you for your response. This would work, but I do not want modify default services, if possible. I’ve noticed that the pamac service uses this command:

ExecStart=/usr/bin/pacman-mirrors -f8
ExecStartPost=-/usr/bin/pacman-mirrors --status

According to the information about pacman-mirrors, this command does the following:

-f, --fasttrack [NUMBER]
            Generates  a  random  mirrorlist  for the users current selected branch, mirrors are randomly se‐
            lected from the users current mirror pool, either a custom pool or the default pool, the randomly
            selected mirrors are ranked by their current access time.  The higher number the higher possibil‐
            ity of a fast mirror.  If a number is given the resulting  mirrorlist  contains  that  number  of
            servers.

If it retrieves mirrors from a custom pool, which I believe I already did with the command described above;

sudo pacman-mirrors -c Spain,France,Netherlands,Germany,Italy,Sweden,Czech_Republic,United_States

how the service isn’t retrieving mirrors from the pool I generated with pacman-mirrors?

I must have missed something or done something wrong, and I don’t know what it is. Would be something related to some .json keeping the mirrors pool and not being updated, My mistake. Just here, for example:

/var/lib/pacman-mirrors/custom-mirrors.json

How can I create a custom pool, so pacman-mirrors -f8 retrieves the mirrors from the custom pool?

Thank you.

Might be a bug or a change. The wiki is updated last year and there was a major update after that, some parameters were changed. Something was deprecated but i do not remember exactly.

What i last tried was using the interactive option and it worked. Try it.

sudo pacman-mirrors --interactive

2 Likes

-i or --interactiveoption shows local mirrors only

To show all available mirrors, use -d or --default:

sudo pacman-mirrors -id

Manjaro update announcements also include a link to check if mirrors are up to date

3 Likes

Is it possible for Pamac to update or generate the mirror list simply by accessing or exiting its preferences? If I select Spain in Pamac, exit the application, and then, days later, run pacman-mirrors selecting several countries via the terminal, but then access Pamac’s preferences, will my custom mirror pool be overwritten?

If so, Pamac’s graphical interface for mirrors is rather… chaotic. Pamac should update the mirror pool only when the “Update Mirrors” button is clicked. If it detects a custom list that is neither “Worldwide” nor the selected option in the mirror list dropdown menu, it should change the selected option to “Manual” and disable the “Update Mirrors” button until “Worldwide” or a country from its list is selected, and the same if you explicit select Manual on this list, the “update mirrors” button should be disabled, so while in manual mode, Pamac should no manage the mirrors at all.

All these are guesses, since I am not sure how Pamac works.

Thank you anyway.

Pamac does not anything but uses pacman-mirrors

Pamac has a timer pamac-mirrorlist.timer which rebuild your mirrorlist.

The timer calls pacman-mirrors to generate an up-to-date mirrorlist.

See man pacman-mirrors for the manual.

The short version is that pacman-mirrors uses a mirror-pool.

This can be the default or a custom pool.

If a custom pool exist it will never change. The files are stored in /var/lib/pacman-mirrors

ls /var/lib/pacman-mirrors
2 Likes

Pamac GUI preferences has a dropdown menu to Use mirrors from:

  • A single specific country (similar to pacman-mirrors -c)
  • Or the Global CDN mirrors
  • Or Worldwide mirrors, (similar to pacman-mirrors -d)

There is also a Refresh Mirrors to refresh the local mirrorlist

Pamac GUI preferences does not support selection of multiple countries, so clicking Refresh Mirrors would change the local mirrorlist to a single country, Global or Worldwide.

1 Like

Aha, this is likely to become a more intensely interesting topic if aga-gating starts to bite…

In the past, I favoured the flag ‘–continent’ which would often find me Thai servers, together with a couple of others in neighbouring countries in the general area.

However, this isn’t always a great policy, and mirrors aren’t all equal.

Currently I have:

❯ pacman-mirrors
Pacman-mirrors version 5.3
Local mirror status for testing branch
Mirror #1   OK  00:02   United_Kingdom  https://ask4.mm.fcix.net/manjaro/
Mirror #2   OK  00:30   New_Zealand     https://mirror.2degrees.nz/manjaro/
Mirror #3   OK  00:37   Spain           https://mirrors.ft.uam.es/manjaro/
Mirror #4   OK  00:02   United_States   https://nocix.mm.fcix.net/manjaro/
Mirror #5   OK  00:13   Bulgaria        https://manjaro.ipacct.com/manjaro/
Mirror #6   OK  02:16   Poland          https://ftp.psnc.pl/linux/manjaro/
Mirror #7   OK  08:16   Italy           https://ba.mirror.garr.it/mirrors/manjaro/
Mirror #8   OK  00:16   Portugal        https://mirrors.up.pt/pub/manjaro/

My updates make good use of my connection.

If these start to turn red, then I refresh with my abbreviation/alias ‘mup’ (for mirrors-up):

sudo pacman-mirrors -f8 --timeout 3

This is more effective than forcing a region.

2 Likes

Yes, but my problem isn’t with mirror management itself, which can be easily controlled with pacman-mirrors from the terminal. My question is whether Pamac, simply by accessing its preferences without clicking the “Refresh Mirrors” button, updates the mirror list based on the selection in its dropdown menu.

It also doesn’t support a “Manual” mode for when you set mirrors using terminal commands, and its dropdown menu doesn’t indicate this.

In other words, for me, the problem lies with Pamac’s graphical interface for mirror management, rather than with mirror selection or handling, and the potential problem of Pamac overwriting the custom mirror list with one generated by itself, even if it is based on the selection from its list of countries/sources.

Thanks to everybody for the replies.

As already mentioned Pamac is simplistic - upon selecting from the drop down - pamac generates the corresponding pacman-mirrors command, which will rewrite your custom mirror pool and the mirror list used by the package manager.

The mirrorlist timer supplied with pamac will attempt to rewrite your mirrorlist on a wwekly schedule.

If that is not desirable - you will need to either disable the timer and mask the service or ensure you only have one mirror in your custom mirror pool.

 $ cat /usr/lib/systemd/system/pamac-mirrorlist.timer
[Unit]
Description=Generate mirrorlist weekly

[Timer]
OnCalendar=Thu *-*-* 7:00:00
RandomizedDelaySec=15h
Persistent=true

[Install]
WantedBy=timers.target
 $ cat /usr/lib/systemd/system/pamac-mirrorlist.service
[Unit]
Description=Generate mirrorlist
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/pacman-mirrors -f8
ExecStartPost=-/usr/bin/pacman-mirrors --status

A lesser used option is to use the Static configuration of pacman-mirrors

## Static configuration
## Add a comma separated list of urls to use
## e.g. Static = https://mirror1.tld/manjaro/,https://mirror2.tld/manjaro/
# Static =
3 Likes

Thank you, but as far as I know pacman-mirrors -f8 will take the custom pool to generate the mirror list file if this custom pool /var/lib/pacman-mirrors/custom-mirrors.json file exists, right? so, if I configure a custom pool /var/lib/pacman-mirrors/custom-mirrors.json trough pacman-mirrors -c [country 1][, country 2]...[, country N] the service triggered by the Pamac timer should generate a mirror list in base to this custom pool, right? So, in reality there is not need to mask the timer, or modify the service, should be enough using pacman-mirrors -c or pacman-mirrors -i and never change the selected setting in the dropdown list, in the Pamac.'s preferences.

Am I right in this assumption? Thank you.

That sentence is the keyword

  • if you do not change your pacman mirror list by using the dropdown list provided by pamac
  • then the custom list pool you have created will (should) never change.

EDIT: remember that pamac comes with a timer which will shuffle your mirror list on a weekly schedule.

Shuffling the mirror list is not the same as changing the mirror pool.

Your custom mirror pool is /var/lib/pacman-mirrors/custom-mirrors.json.

Sample mirror pool
 $ cat /var/lib/pacman-mirrors/custom-mirrors.json 
[
    {
        "branches": [
            0,
            1,
            1
        ],
        "continent": "Europe",
        "country": "Austria",
        "last_sync": "00:09",
        "protocols": [
            "https"
        ],
        "resp_time": 0,
        "url": "https://mirror.easyname.at/manjaro/"
    }
]

Your mirror list is /etc/pacman.d/mirrorlist generated using mirror pool (custom if it exist otherwise default)

Sample mirrorlist
 $ cat /etc/pacman.d/mirrorlist
##
## Manjaro Linux default mirrorlist
## Generated on 2026-04-02 09:55
##
## Please use 'pacman-mirrors -f [NUMBER] [NUMBER]' to modify mirrorlist
## (Use 0 for all mirrors)
##

## Country : BUILDMIRROR
Server = https://uex.dk/repos/manjaro/unstable/$repo/$arch
2 Likes

Yes, that is how i used it for years.

2 Likes

If you do not click on Refresh Mirrors, Pamac has no reason to refresh the local mirrorlist

Pamac supports only a small subset of pacman-mirrors CLI functions, just enough for a new user to change the mirrors if a mirror is not up to date

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.