Rankmirrors not working per documentation

It seems like rankmirrors is vastly outdated? Nothing works like in the arch documentation Arch Wiki Mirrors.

For example, this command is supposed to rank all the mirrors, but instead I get this error

$ rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup
Version 4.21.0
USAGE:
 pacman-mirrors [-h] [-f [NUMBER]] [-i [-d]] [-m METHOD] [--status]
                [-c COUNTRY [COUNTRY...] | [--geoip] | [--continent]]
                [-l] [-lc] [-q] [-t SECONDS] [-v] [-n]
                [--api] [-S/-B BRANCH] [-p PREFIX]
                        [-P PROTO [PROTO...]] [-R] [-U URL]
rankmirrors: error: unrecognized arguments: 6 /etc/pacman.d/mirrorlist.backup

Also, running this without the -n argument (which I dont know if its required) gives this result

$ rankmirrors /etc/pacman.d/mirrorlist.backup
Version 4.21.0
USAGE:
 pacman-mirrors [-h] [-f [NUMBER]] [-i [-d]] [-m METHOD] [--status]
                [-c COUNTRY [COUNTRY...] | [--geoip] | [--continent]]
                [-l] [-lc] [-q] [-t SECONDS] [-v] [-n]
                [--api] [-S/-B BRANCH] [-p PREFIX]
                        [-P PROTO [PROTO...]] [-R] [-U URL]
rankmirrors: error: unrecognized arguments: /etc/pacman.d/mirrorlist.backup

I’ve read that rankmirrors moved to the pacman-contrib repo, so it’s probably the reason it’s outdated? Or something else is going on that I do not quite get.

Edit:

From my understanding, I’m most probably wrong, but it seems like rankmirrors was replaced by pacman-mirrors and rankmirrors is just an alias to it now, even though it is incompatible. But I would need someone to confirm that information.

it seems like now that this is the new way

# OLD: rankmirrors -n 6 mirrorsfile
# NEW: 
pacman-mirrors -f 6

Arch wiki contains information for Arch Linux tools.

Pacman Mirrors is not an Arch Linux tool, but rather a Manjaro specific tool.

So check out the Manjaro Wiki page for it:

https://wiki.manjaro.org/index.php/Pacman-mirrors#Update_mirrorlist_with_the_fastest_mirrors

PS: rankmirrors is provided by pacman, but is symlinked to pacman-mirrors.

1 Like

Thanks! Much appreciated.

I could say, it is a little bit confusing that rankmirrors is an alias to an incompatible to rankmirrors tool. It’s kinda confusing for a user that doesn’t know that rankmirrors is an alias in his system and every forum showing a different incompatible way with the alias itself for using rankmirrors.

Could we probably improve this somehow by … maybe removing the alias? It doesn’t quite make sense to me for the alias to exist at all from that perspective.

Or even adding a note to the user when running the alias informing him that this is not a compatible tool and they should use pacman-mirrors instead would totally help save some time.

Removing rankmirrors all together is probably the best solution, as the original command won’t work on Manjaro anyway.