Unable to install anything with Pacman ("Unable to lock database" and "failed retrieving file 'core.db'".

Hi! I'm new to Manjaro XFCE and Linux (I come from Ubuntu 20.04) and I was trying to install Vivaldi through pacman... and this is what happens:

I ran sudo pacman -S vivaldi.

Received:

warning: database file for 'core' does not exist (use '-Sy' to download)
warning: database file for 'extra' does not exist (use '-Sy' to download)
warning: database file for 'community' does not exist (use '-Sy' to download)
warning: database file for 'multilib' does not exist (use '-Sy' to download)
error: failed to init transaction (unable to lock database)

Ran sudo pacman-mirrors -g
It runs succesfully and generates a list.

Ran sudo pacman -Syyu
Received Failed to synchronize all databases (unable to lock database) at 'core', 'extra', 'community', 'multilib'. -so, same error message.

Ran sudo rm /var/lib/pacman/db.lck
Ran sudo pacman -Syyu again.
Failed again, but this time with failed retrieving file 'core.db' from [URL LIST]: Resolving timed out after 1000 milliseconds.

Ran sudo pacman-mirrors -f5 && sudo pacman -Syyu.
This is the mirror list:

::France          : http://ftp.free.org/mirrors/repo.manjaro.org/repos/stable
::United_States   : https://mirror.dacentec.com/manjaro/stable
::Belgium         : https://mirror.futureweb.be/manjaro/stable
::France          : https://manjaro.mcofficer.me/stable
::Italy           : https://ct.mirror.garr.it/mirrors/manjaro/stable
::INFO Mirror list generated and saved to: /etc/pacman.d/mirrorlist

Ran once sudo pacman -Syyu again and it failed with the same problem:
Failed to synchronize all databases (unable to lock database) at 'core', 'extra', 'community', 'multilib'.

Ran sudo pacman-mirrors -f
Success

Ran rm /var/lib/pacman/db.lck.
Ran sudo pacman -Syyu and it failed AGAIN with "failed retrieving file 'core.db' from [URL LIST]: Resolving timed out after 1000 milliseconds".

What am am I doing wrong? What else can I try?

Thank you so much in advance.

After that last pacman-mirrors -f (or after any pacman-mirrors really)
You must do sudo pacman -Syyu

But .. still nothing huh?

Seems like it could be a network issue.
We have seen things like University networks blocking repos..
Maybe try changing your DNS if you can.
Maybe you could try with pacman-mirrors -i to interactively select a mirror.
You can check status at repo.manjaro.org

Hi, thank you for your quick answer!

Well, I'm checking the entries for Brazil and Chile at repo.manjaro.org (those are the closest mirrors to my country) and I have access to their files from Firefox without any problem. How would I use the pacman-mirrors -i command to specify both mirrors? I see on the manual page that the custom list is created with the command and when I run it starts displaying a list of mirrors. Do I wait until its done and then select the ones I found at Brazil and Chile?

Thanks!

Yes just wait until finished and mark the ones you want to keep.
I guess we could have used something like sudo pacman-mirrors -ic Chile Brazil
BTW unless you changed it .. FF uses its own DNS so its not exactly a true comparison.
Lets choose a mirror .. I dont speak portugese .. so Ill grab a chilean one .. https://mirror.ufro.cl/manjaro/
(where are you that those 2 are both closest?)

Can you check in your terminal?

ping mirror.ufro.cl -c 5

Okay, it's currently running sudo pacman-mirrors -i so I'll wait for it.

The ping outcome is:

5 packets transmitted, 5 received, 0% packet loss, time 4466ms
rtt min/avg/max/mdev = 175.146/187.738/212.830/14.401 ms

I'm at Colombia!

oh.. we used to have mirrors colombiano .. guess not anymore. :slightly_frowning_face:
And it looks like you can ping the chileno mirror .. so guess we will see after that.

Well, it's done. I'm selecting the Brazilian and Chilean mirrors but I see that some dutch and American mirrors rank higher on response time. Should I select them as well, or leave the Latin American mirrors by now?

Yeah, I saw that there was a mirror at Universidad de Nariño here in Colombia. Are you from Latin America as well?

I spent most of my time in Argentina/Uruguay and still have family and friends .. but not born or living there now. Though drinking yerba mate right now :slight_smile:
The selection is up to you ... maybe try with some of the fast euros included, and if it doesnt work, trim it to just the locals.

Ok, well by now I'll select the local mirrors then. It's done, should I run sudo pacman -Syyu again?

Nice! Uruguay and Chile are the two countries I want to visit the most here at Latin America. And Cavani is my favorite player.

Yes .. we must always force -yy after changing mirrors .. and we dont want to sync without updating .. so after touching mirrors must always sudo pacman -Syyu

Damn, it's failing again

error: failed to update core (unable to lock database)
error: failed to update extra (unable to lock database)
error: failed to update community (unable to lock database)
error: failed to update multilib (unable to lock database)
error: failed to synchronize all databases

As soon as I hit enter I received the errors, it took almost no time.

sudo rm /var/lib/pacman/db.lck

To unlock pacman and get online.

Now I'm receiving the

error: failed retrieving file 'core.db' from manjaro.c3sl.ufpr.br : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'core.db' from linorg.usp.br : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'core.db' from www.caco.ic.unicamp.br : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'core.db' from manjaro.dcc.uchile.cl : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'core.db' from mirror.ufro.cl : Resolving timed out after 10000 milliseconds
error: failed to update core (download library error)
error: failed retrieving file 'extra.db' from manjaro.c3sl.ufpr.br : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'extra.db' from linorg.usp.br : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'extra.db' from www.caco.ic.unicamp.br : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'extra.db' from manjaro.dcc.uchile.cl : Resolving timed out after 10000 milliseconds
error: failed retrieving file 'extra.db' from mirror.ufro.cl : Resolving timed out after 10000 milliseconds
error: failed to update extra (download library error)
Interrupt signal received

messages. It's an unavoidable loop.

Don't interrupt it unless you truly have to, that is what is causing your database to become locked.

I notice you said you were trying to install Vivaldi, did you happen to add the Herecura repo? If so your repos might be misconfigured.

EDIT: Try the Costa Rican mirror, very reliable in my experience. Even more than my United States' mirrors. How old is your Manjaro install?

I must have pressed a wrong key while switching windows. I ran it again and I'm still getting the same issues. I installed Manjaro today! I haven't added anything, no repos, no nothing.

I ran sudo pacman -Syu --debug and this is the outcome. It's a very long list, however, and I'm not knowledgeable enough to determine what's relevant or not, sorry :cry: Do you know what can I look for in this list? What could give me a clue?

debug: pacman v5.2.1 - libalpm v12.0.1
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: CacheDir: /var/cache/pacman/pkg/
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: HoldPkg: manjaro-system
debug: config: SyncFirst: manjaro-system
debug: config: SyncFirst: archlinux-keyring
debug: config: SyncFirst: manjaro-keyring
debug: config: arch: x86_64
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config: SigLevel: PackageRequired
debug: config file /etc/pacman.conf, line 77: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config: SigLevel: PackageRequired
debug: config file /etc/pacman.conf, line 81: including /etc/pacman.d/mirrorlist
debug: config: new section 'community'
debug: config: SigLevel: PackageRequired
debug: config file /etc/pacman.conf, line 85: including /etc/pacman.d/mirrorlist
debug: config: new section 'multilib'
debug: config: SigLevel: PackageRequired
debug: config file /etc/pacman.conf, line 92: including /etc/pacman.d/mirrorlist
debug: config: finished parsing /etc/pacman.conf
debug: setup_libalpm called
debug: option 'logfile' = /var/log/pacman.log
debug: option 'gpgdir' = /etc/pacman.d/gnupg/
debug: option 'hookdir' = /etc/pacman.d/hooks/
debug: option 'cachedir' = /var/cache/pacman/pkg/
debug: registering sync database 'core'
debug: database path for tree core set to /var/lib/pacman/sync/core.db
debug: "/var/lib/pacman/sync/core.db" is not readable: No such file or directory
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': https://manjaro.c3sl.ufpr.br/stable/core/x86_64
debug: adding new server URL to database 'core': http://linorg.usp.br/manjaro/stable/core/x86_64
debug: adding new server URL to database 'core': https://www.caco.ic.unicamp.br/manjaro/stable/core/x86_64
debug: adding new server URL to database 'core': http://manjaro.dcc.uchile.cl/stable/core/x86_64
debug: adding new server URL to database 'core': https://mirror.ufro.cl/manjaro/stable/core/x86_64
debug: registering sync database 'extra'
debug: database path for tree extra set to /var/lib/pacman/sync/extra.db
debug: "/var/lib/pacman/sync/extra.db" is not readable: No such file or directory
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': https://manjaro.c3sl.ufpr.br/stable/extra/x86_64
debug: adding new server URL to database 'extra': http://linorg.usp.br/manjaro/stable/extra/x86_64
debug: adding new server URL to database 'extra': https://www.caco.ic.unicamp.br/manjaro/stable/extra/x86_64
debug: adding new server URL to database 'extra': http://manjaro.dcc.uchile.cl/stable/extra/x86_64
debug: adding new server URL to database 'extra': https://mirror.ufro.cl/manjaro/stable/extra/x86_64
debug: registering sync database 'community'
debug: database path for tree community set to /var/lib/pacman/sync/community.db
debug: "/var/lib/pacman/sync/community.db" is not readable: No such file or directory
debug: setting usage of 15 for community repository
debug: adding new server URL to database 'community': https://manjaro.c3sl.ufpr.br/stable/community/x86_64
debug: adding new server URL to database 'community': http://linorg.usp.br/manjaro/stable/community/x86_64
debug: adding new server URL to database 'community': https://www.caco.ic.unicamp.br/manjaro/stable/community/x86_64
debug: adding new server URL to database 'community': http://manjaro.dcc.uchile.cl/stable/community/x86_64
debug: adding new server URL to database 'community': https://mirror.ufro.cl/manjaro/stable/community/x86_64
debug: registering sync database 'multilib'
debug: database path for tree multilib set to /var/lib/pacman/sync/multilib.db
debug: "/var/lib/pacman/sync/multilib.db" is not readable: No such file or directory
debug: setting usage of 15 for multilib repository
debug: adding new server URL to database 'multilib': https://manjaro.c3sl.ufpr.br/stable/multilib/x86_64
debug: adding new server URL to database 'multilib': http://linorg.usp.br/manjaro/stable/multilib/x86_64
debug: adding new server URL to database 'multilib': https://www.caco.ic.unicamp.br/manjaro/stable/multilib/x86_64
debug: adding new server URL to database 'multilib': http://manjaro.dcc.uchile.cl/stable/multilib/x86_64
debug: adding new server URL to database 'multilib': https://mirror.ufro.cl/manjaro/stable/multilib/x86_64
:: Synchronizing package databases...
debug: url: https://manjaro.c3sl.ufpr.br/stable/core/x86_64/core.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'core.db' from manjaro.c3sl.ufpr.br : Resolving timed out after 10000 milliseconds
debug: url: http://linorg.usp.br/manjaro/stable/core/x86_64/core.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'core.db' from linorg.usp.br : Resolving timed out after 10000 milliseconds
debug: url: https://www.caco.ic.unicamp.br/manjaro/stable/core/x86_64/core.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'core.db' from www.caco.ic.unicamp.br : Resolving timed out after 10000 milliseconds
debug: url: http://manjaro.dcc.uchile.cl/stable/core/x86_64/core.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'core.db' from manjaro.dcc.uchile.cl : Resolving timed out after 10000 milliseconds
debug: url: https://mirror.ufro.cl/manjaro/stable/core/x86_64/core.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'core.db' from mirror.ufro.cl : Resolving timed out after 10000 milliseconds
debug: failed to sync db: download library error
error: failed to update core (download library error)
debug: url: https://manjaro.c3sl.ufpr.br/stable/extra/x86_64/extra.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'extra.db' from manjaro.c3sl.ufpr.br : Resolving timed out after 10000 milliseconds
debug: url: http://linorg.usp.br/manjaro/stable/extra/x86_64/extra.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'extra.db' from linorg.usp.br : Resolving timed out after 10000 milliseconds
debug: url: https://www.caco.ic.unicamp.br/manjaro/stable/extra/x86_64/extra.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'extra.db' from www.caco.ic.unicamp.br : Resolving timed out after 10000 milliseconds
debug: url: http://manjaro.dcc.uchile.cl/stable/extra/x86_64/extra.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'extra.db' from manjaro.dcc.uchile.cl : Resolving timed out after 10000 milliseconds
debug: url: https://mirror.ufro.cl/manjaro/stable/extra/x86_64/extra.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'extra.db' from mirror.ufro.cl : Resolving timed out after 10000 milliseconds
debug: failed to sync db: download library error
error: failed to update extra (download library error)
debug: url: https://manjaro.c3sl.ufpr.br/stable/community/x86_64/community.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/community.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'community.db' from manjaro.c3sl.ufpr.br : Resolving timed out after 10000 milliseconds
debug: url: http://linorg.usp.br/manjaro/stable/community/x86_64/community.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/community.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'community.db' from linorg.usp.br : Resolving timed out after 10000 milliseconds
debug: url: https://www.caco.ic.unicamp.br/manjaro/stable/community/x86_64/community.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/community.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'community.db' from www.caco.ic.unicamp.br : Resolving timed out after 10000 milliseconds
debug: url: http://manjaro.dcc.uchile.cl/stable/community/x86_64/community.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/community.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'community.db' from manjaro.dcc.uchile.cl : Resolving timed out after 10000 milliseconds
debug: url: https://mirror.ufro.cl/manjaro/stable/community/x86_64/community.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/community.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'community.db' from mirror.ufro.cl : Resolving timed out after 10000 milliseconds
debug: failed to sync db: download library error
error: failed to update community (download library error)
debug: url: https://manjaro.c3sl.ufpr.br/stable/multilib/x86_64/multilib.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/multilib.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'multilib.db' from manjaro.c3sl.ufpr.br : Resolving timed out after 10000 milliseconds
debug: url: http://linorg.usp.br/manjaro/stable/multilib/x86_64/multilib.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/multilib.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'multilib.db' from linorg.usp.br : Resolving timed out after 10000 milliseconds
debug: url: https://www.caco.ic.unicamp.br/manjaro/stable/multilib/x86_64/multilib.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/multilib.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'multilib.db' from www.caco.ic.unicamp.br : Resolving timed out after 10000 milliseconds
debug: url: http://manjaro.dcc.uchile.cl/stable/multilib/x86_64/multilib.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/multilib.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'multilib.db' from manjaro.dcc.uchile.cl : Resolving timed out after 10000 milliseconds
debug: url: https://mirror.ufro.cl/manjaro/stable/multilib/x86_64/multilib.db
debug: maxsize: 33554432
debug: opened tempfile for download: /var/lib/pacman/sync/multilib.db.part (wb)
debug: curl returned error 28 from transfer
error: failed retrieving file 'multilib.db' from mirror.ufro.cl : Resolving timed out after 10000 milliseconds
debug: failed to sync db: download library error
error: failed to update multilib (download library error)
error: failed to synchronize all databases
debug: unregistering database 'local'
debug: unregistering database 'core'
debug: unregistering database 'extra'
debug: unregistering database 'community'
debug: unregistering database 'multilib'

Thats still just 'timed out' error.
https://curl.haxx.se/libcurl/c/libcurl-errors.html (see #28)
The basics being you cant download from the server [or do so remarkably slow or cant find the file]

I still suspect this is a DNS issue.
(check your router .. or maybe even set in Network Manager - try changing to DNS 1.1.1.1 for cloudflare or 8.8.8.8 for google dns)

EDIT - to include you will need to restart the connection or network manager after making the change.
For example - systemctl restart NetworkManager

2 Likes

Okay, so I should try and change the DNS. I know that nmcli device show shows the current DNS, but how would I change it?

Hmm wait NVM, I can simply edit my network connection through the GUI. Is it enough to add 1.1.1.1 and 8.8.8.8 as additional DNS servers, or should I replace my current DNS? Sorry about the silly questions.

Depends .. you could do it in config files ..
at the router level (router settings .. outside manjaro)
or in Network Manager something like this:
image

1 Like

Okay, I've got this DNS

I'm going to save and run sudo pacman -Syuagain.

Forum kindly sponsored by