Pacman-mirrors -c or -geoip instead of pacman-mirrors -f

The recommened update command is:

pacman-mirrors -f 5 && sudo pacman -Syyu

But why not always use:

pacman-mirrors -c list_of_countries && sudo pacman -Syyu


pacman-mirrors -geoip && sudo pacman -Syyu

What is the advantage of having the intermediate static file, “/var/lib/pacman-mirrors/custom-mirrors.json”?

Isn’t there an advantage to the second and third because the mirrors are only included in “/etc/pacman.d/mirrorlist” if they are up to date? Couldn’t a mirror be fast and out of sync.

Those overwrite your mirrorlist.
Assuming you dont have a mirrorlist only made up of 1 (or a few) all broken mirrors … then -f should be fine to rank from your custom list.
If you dont have a custom mirrorlist … then -f will query all of them.
(well it would … but if you feed it an integer like 5 … well thats the number it will query)
g also has the distinction of focusing on what is nearby - not what is fastest.
So … they all have different uses … but -f makes sense as a default.

All three write to “/etc/pacman.d/mirrorlist”.

Commands 2 and 3 create “/var/lib/pacman-mirrors/custom-mirrors.json” and update “/var/lib/pacman-mirrors/status.json” from git.

I’m just think’n :slight_smile: that commands 2 and 3 are more reliable than 1.

But they arent.
Just ask someone from Iran or China.
They have different uses … and I certainly dont want to overwrite the 5 mirrors I have chosen to use when all I want is to rank their current status.

Further … you have this wrong…

Its not … the recommended update is
pamac update
or if you use pacman
sudo pacman -Syu

Anything else is extra fluff for one reason or another … if you dont understand why you would or would not add to those commands … then you should stick to those basics.

For one thing … doing pacman-mirrors and -Syyu every update is just an unecessary tax on the mirror servers. So dont, unless you have a good reason.

1 Like

It’s 5 years i use manjaro and i never used pacman-mirrors… i manually choose 2-3 mirrors i know are reliable and stick to them since day one


It is my current understanding that this will get the user in trouble if they have the systemd pamac-mirrorlist.timer enabled. It runs pacman-mirrors -f8.

Doc only mentions -Syyu. From reading, it seems like a small price to pay to ensure one of the important part ("/var/lib/pacman/sync") of the install chain is up to date. I could be wrong though :wink: The doc also mentions both. There is no mention of the systemd pamac-mirrorlist.timer in the doc, so the user might not be aware that “/etc/pacmand.d/mirrorlist” may have changed.

True … Which is why I suggested pamac first … and then relayed -Syu for “if you use pacman”.
Which could also be understood as “a user who knows what they are doing and does not use pamac” which probably also means “does not use pamac-mirrorlist.timer”.

And … it seems in more recent pacman … -Syu is sufficient even if you have changed mirrors.

If using pacman there are also other things to consider … such as making sure to rebuild modules, same going for updating or rebuilding AUR packages separately, and so on.

That’s another way :slight_smile: I have friends who follow that strategy.

Do you check the status of those mirrors before an upgrade either at the website or via pacman-mirrors --status (well probably not that later one)?

To tell the truth, I haven’t used pamac much. I did use the GUI to build a package from AUR.

If you have a source for the above, that would be interesting to read. I was looking at the pacman changelog and didn’t see anything that might indicate a change.

The man page for pacman-mirrors says ALWAYS (all caps and underlined :slight_smile: ) to use -Syyu after running pacman-mirrors.

When I first used Manjaro, I selected KDE (I’m now XFCE), and had problems with Octopi. Learning the ropes of Manjaro, I read and searched, searched and read the now archived forum and found an entry that said, something along the lines of Manjaro doesn’t recommend Octopi. So I’ve used pacman ever since because I had some experience with it.

I know … I probably wrote it.

My new information for it was … interacting with other users and then testing it myself.

I agree, that is the last thing any user would want to do. But is it a tax on the servers if it is limited to just a specific country? Of the 99 mirrors in the list, at “/var/lib/pacman-mirrors/status.json” the user would be “pinging” a small fraction. The little while I’ve been in this forum, when I see a thread where a user is having a problem with an upgrade, it seems that the response is the first command and the user has success. I was wondering if those type of problems would be eliminated altogether if they used command two.

I’m beginning to appreciate the simplicity of @scachemaille response.

The point is more that yy takes heaps more than any other transaction.
So it should be avoided unless needed.

Not really … the only reason to need it at all is to sort/rank mirrors.
Its possible that the user created or inherited some bad ones or never sorted them at all.
In any of those cases -f should be enough, and geoip would also be acceptable … really they just need a good mirrors somehow.
If on the other hand a user has an entirely broken mirror pool … then resetting it using something like -c might be helpful.

In any case … once any of that is done … there should be no need to run pacman-mirrors again unless you want to change branches, or your mirror is broken somehow, etc.