Pacman-mirrors on PC thinks I am in Australia, laptop shows correct country NL

I have performed a clean install using USB stick of Manjaro Gnome last weekend on my PC (connected via LAN) and on my laptop (connected via WiFi to the same internet connection). Both devices are in the same house.

Also good to know:

  • On both devices, language is en_GB, region Netherlands, keyboard en_US with Euro on 5. Chosen during Manjaro setup.
  • Both devices had a working internet connection during Manjaro setup.
  • Both devices have Location Services enabled and timezone and time set to auto.
  • Both devices are Intel based, one with Fujitsu mainboard, core i3-8100 and the other is an HP x360 14-ea0110nd laptop released last year.

On the PC, I get this:

sudo pacman-mirrors --geoip                                                                                                                                                            
::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.135 Australia      : https://manjaro.lucassymons.net/
  3.071 Australia      : https://mirror.aarnet.edu.au/pub/manjaro/
::INFO Writing mirror list
::Australia       : https://manjaro.lucassymons.net/stable
::Australia       : https://mirror.aarnet.edu.au/pub/manjaro/stable
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist

On the laptop it is correct:

sudo pacman-mirrors --geoip                                    
::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.067 Netherlands    : https://manjaro.mirrors.lavatech.top/
  0.074 Netherlands    : https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/
  0.072 Netherlands    : https://mirror.koddos.net/manjaro/
::INFO Writing mirror list
::Netherlands     : https://manjaro.mirrors.lavatech.top/stable
::Netherlands     : https://mirror.koddos.net/manjaro/stable
::Netherlands     : https://ftp.nluug.nl/pub/os/Linux/distr/manjaro/stable
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist

I am based in Netherlands. Why the difference between devices? It is almost the opposite sides of the world!

Do you use a VPN (or similar) on the PC?

No :laughing:
I just installed Manjaro Gnome. I haven’t done anything yet. Didn’t install or configure anything else except time/date set to auto and location services enabled.

This may happen if there is no up-to-date mirrors for your geoip location (and the global don’t count) as registered by the main repo server.

also:

curl ifconfig.me                                                                                                                                                                              
 <an IP addres>

Same IP address on both devices.

But if I use pacman mirrors to create a new mirrorlist, Australia will be my new mirror. Next run, it will always be that location… unless I explicitly use --geoip again? so it is a bug?

Still does not explain my usecase btw: I did a clean install on Saturday on both devices. Ran the command same day on both devices. From the same IP address. One gives back NL, the other Austalia…

All arguments which limits the pool by country will generate a custom mirror pool and the mirror pool will be used on subsequent runs.

My personal recommendation is to avoid mirror shopping.

Cherrypick one mirror which provides the best result for your use case and stick with it.

You will create a more stable experience.

The Manjaro package manager will setup a mirrorlist timer which will recreate your mirrorlist at - I think - a weekly interval.

pacman-mirrors uses the Endpoints | GeoJS · REST/JSON/JSONP GeoIP API service

I cannot say what the issue is - I have just tested from my location - it is correctly identified as Denmark.

OK in that case I will just ignore this, I used to run sudo pacman-mirrors -g --continent -P https --api after a new OS install.

But still I do wonder, if Manjaro package manager creates a new mirrorlist weekly or even monthly, if the PC won’t be stuck with Australia again.

the -g is only a run argument - it doesn’t do anything - so that may be why you are speculationg why you get australia. Using –geoip should get the correct result - in any case –continent should return european countries - at least it does when I have tested the app.

OK, but it doesn’t matter if I use -g or --continent or just --geoip. The difference between devices is there with every one of those options.

The -g option is irrelevant and only needed if run without any other options and the only thing it does is to prevent pacman-mirrors from just displaying the status but actually configure the mirrorlist.

-g has absolutely nothing to do with --geoip and there is no --geolocation argument.

If your system consistently choose Australia - you need to break free of the custom mirror pool - add the --interactive to cherry-pick from up-to-date mirrors - add --no-status to include all mirrors

sudo pacman-mirrors -c all

Or simply remove the file

sudo rm -f /var/lib/pacman-mirrors/custom-mirrors.json

Yes I meant --continent. Anyway thanks. I did indeed use interactive mode to select a couple of mirrors as a workaround. I just wanted to verify this must be some kind of bug.

But thanks for informing me about mirror shopping. From now on I will just leave it to the OS to figure out and refrain from using pacman-mirrors unless I experience issues.

Create a file

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

With the following content (you can replace the mirrorurl (CDN77) with a mirror of choice)

$ cat /var/lib/pacman-mirrors/custom-mirrors.json 
[
    {
        "country": "Global",
        "protocols": [
            "https"
        ],
        "url": "https://mirrors.manjaro.org/repo/"
    }
]

This should ensure a stable operation of your system and the pamac-mirrorlist.timer will never change your mirror list.