Curious why Pacman -Syyu fails and chooses mirrors that don't work

Can someone enlighten me on this please? I installed Manjaro on a new hard drive. The machine already ran Manjaro, and this was a just new disc replacement.

As soon as the installation was complete and running successfully, I did the following:

$ sudo pacman -Syyu
:: Synchronising package databases...
error: failed retrieving file 'core.db' from manjaro.barata.pt : Resolving timed out after 10000 milliseconds
 core                                         150.6 KiB   286 KiB/s 00:01 [#########################################] 100%
error: failed retrieving file 'extra.db' from manjaro.barata.pt : Resolving timed out after 10000 milliseconds
 extra                                       1777.7 KiB   845 KiB/s 00:02 [#########################################] 100%
error: failed retrieving file 'community.db' from manjaro.barata.pt : Resolving timed out after 10000 milliseconds
 community                                      5.0 MiB  1082 KiB/s 00:05 [#########################################] 100%
error: failed retrieving file 'multilib.db' from manjaro.barata.pt : Resolving timed out after 10000 milliseconds
 multilib                                     183.5 KiB   524 KiB/s 00:00 [#########################################] 100%
:: Starting full system upgrade...
warning: a52dec: local (0.7.4-10) is newer than extra (0.7.4-9)
warning: aalib: local (1.4rc5-13) is newer than extra (1.4rc5-12)
warning: accounts-qml-module: local (0.7-2) is newer than extra (0.7-1)
.
. etc.

Incidentally I have no idea why it thinks I am in Portugal – my location is Thailand, another continent altogether.

With a bit of research, I looked at the mirror list file and removed Portugal, as below. I was then able to perform the sync. Why should I need to do this?

My location is Thailand, so why is it attempting to use Portugal, and why does it fail anyway?

$sudo vi /etc/pacman.d/mirrorlist

## Country : Portugal
## Server = http://manjaro.barata.pt/stable/$repo/$arch
## Country : Indonesia
Server = http://kambing.ui.ac.id/manjaro/stable/$repo/$arch
## Country : United_Kingdom
Server = https://www.mirrorservice.org/sites/repo.manjaro.org/repos/stable/$repo/$arch

Another point to make is that although this installation was carried out with access to the internet (i.e. during the installation process), when I first attempted to do this new installation today, I didn’t enable networking on that first instance, so the installation completed from my flash drive without access to the internet. In that instance, when I rebooted after successful installation and then enabled internet access, it was complaining that it couldn’t access the Poland mirror. Why Poland?

To summarise, if I install Manjaro with no internet access, then enable internet access after booting, then sync, it tries to contact a Poland mirror.

But, if I install Manjaro with internet access available during the install process, and then sync it, it attempts to use a Portugal mirror.

And why should the mirrors fail every time like this anyway? Shouldn’t this be straightforward without having to do all this?

Ironically, when it fails, it says “nothing to do”.

.
.
warning: zsh: local (5.8-1) is newer than extra (5.6.2-1)
warning: zstd: local (1.4.4-1) is newer than core (1.3.6-1)
 there is nothing to do

When an ISO is created a mirror list is generated but it is a random mirror list which explains why the first mirror is another country - even continent.

This mirror list is copied to the system installed from the ISO and usually it does not contain invalid mirrors but as the pacman-mirrors on the ISO may be built long time ago, a mirror may have decommisioned itself by request, not being up-to-date or not answering.

If you are online while installing - if I recall correct - there is module which generates a mirrorlist using below command (which is a partially random generator) - read more on pacman-mirrors from the link at then end of the comment

pacman -f 5

It is highly recommended to run pacman-mirrors after install and so creating a mirror pool better matching the actual circumstances.

sudo pacman-mirrors --continent && sudo pacman -Syyu

Subsequently you only need to run

sudo pacman -Syu

Read more at

5 Likes

Thanks very much for enlightening me on this @linux-aarhus I see what you mean, although it seems that determining the list of mirrors at the time of creating the ISO is the weakspot in this method. Why not establish the most up-to-date list of mirrors when it is first needed and without it being necessary to run the command pacman-mirrors to do so? If for example there is no internet access during installation, then there is not much point in having a list of mirrors from the ISO, since they won’t work anyway in the absence of internet connectivity. So why not build that list automatically the first time internet access is made available?

Anyway it seems that the Portugal mirror has failed then and probably also the Poland mirror also, because that failed for me earlier today. My ISO was created in April, so it isn’t long ago.

Also, why doesn’t Pacman use the next mirror in the list (in this case Indonesia) when I run Pacman -Syyu ?

If we look at the results, Pacman -Syyu doesn’t bother to try other mirrors despite failing. In fact it doesn’t appear to notice that it’s failing. It continues to try to sync, almost in ignorance that the mirror doesn’t work. So why not use the next mirror instead?

The mirrorlist is an integral part of the system - so the mirrorlist must exist.

There is a lot factors at play and you cannot ensure a specific mirrorlist is valid when the ISO is created which is why it is created randomly.

When an internet connection is not available at install time there is no way of validating the included mirrorlist.

Manjaro uses pacman-mirrors as the means to generate a mirrorlist and at install time the mirrorlist is generated randomly from known up-to-date-mirrors ONLY IF an active internet connnection exist.

Don’t confuse pacman and pamac because they are different applications.

pacman will always continue with the next mirror in the mirrorlist but it requires an active internet connection.

I don’t know how pamac handles it.

Thanks for the reply, I understand what you say. Incidentally I didn’t mention pamac. I’m only speaking about Pacman.

Just to clarify though, it wasn’t quite as you say, because I did have internet access during the second installation today and the failed Portugal mirror was still written. Briefly, the findings were:

(1) Installed Manjaro with no internet connection, then subsequently enabled internet after completion. First mirror in the list - Poland, which failed anyway.

(2) Wiped the hard drive completely. Installed Manjaro again with internet connectivity. First mirror in the list - Portugal, which failed.

pacman will always continue with the next mirror in the mirrorlist but it requires an active internet connection.

That doesn’t appear to be how Pacman is behaving. It fails on Portugal and doesn’t bother with the second mirror in the list. Then when I remove Portugal and re-run Pacman -Syyu, it successfully picks up Indonesia.

No matter what, the mirrorlist will almost always require a regeneration to match your location and unless you tell pacman-mirrors otherwise it will only give you up-to-date mirrors for your branch.

I don’t know if there is a connection error limit - but usually pacman will try the next mirror on mirror fail.

So just use pacman-mirrors using --continent or --geoip after install - then run a full sync using pacman -Syyu.

man pacman-mirrors

Thanks, this has become a really useful thread to refer back to in the future. I think the important point, that you make, is that any new installation requires an update of the mirrors. In fact even from time to time, it looks like we should re-check our mirrors anyway.

Perhaps this is an overlooked part of system maintenance for some users? I know in my case, I tend to install and leave it.

Pamac installs a systemd timer, that kicks off a mirrorlist update every week.

Good question.

In addition to the very nice responses above, I’d add, before any update, the Announcement category should be viewed, at least the first entry. @philm puts text at the beginning like:

The timer @Strit mentioned can be view via systemctl list-timers. If you look at the service file, pacmac-mirrorlist.service, it runs pacman-mirrors -f8.

I’ve disabled/masked this in favor of doing the command prior to an update. One of the first steps for me, after a Manjaro initial install, is to either run pacman-mirrors --country <COUNTRY> or manually edit the file. The former is quicker :wink: . I’d do the same, no matter the distribution or package management system - I’m think’n, How and where am I getting updates.

Creating a custom mirrorlist from the valid mirrorlist does not need to be done often, and maybe only once. But checking the customer mirrorlist to create a runtime mirrorlist should be done before every update.

Besides the command, there is the web site, Manjaro Repository website.

pamac also has an option to Refresh Mirrors List,

I mostly use pacman, but in pamac I have these questions:

  1. :hamburger: > Refresh database
    Is this the same as pacman-mirrors --fasttrack && pacman -Sy?

  2. If a user clicks the Updates button, does pamac do a Refresh for the user, or does the user have to click Refresh and then Updates?

  3. What does pamac do if all the runtime repositories in /etc/pacman.d/mirrorlist, are out of date or not responding? Does pamac, tell the user to try again later, select alternative mirrors, or other?

    • I commented all repos in the runtime mirrorlist file and when I clicked Refresh a warning messagebox was displayed, “no servers configured for repository”. When I had a non-existent repo, it came back with another warning messagebox “Failed to synchronize databases”.

I don’t run the Update Notifier (pamac-tray), which might do some of the above, but not sure.

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