You are not logged in.

#1 2023-03-10 03:56:02

GENgreen
Member
Registered: 2023-02-17
Posts: 14

pacman error : failed to synchronize all databases

after i use pacman -Syyu
it stopped and i try this again this happen

:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)

system still work well
no shutdown just pacman don't work
i have reboot it but pacman still don't work
and i can't use pacman to download and install thing
use KDevelop as an example

error: failed to init transaction (unable to lock database)
error: could not lock database: File exists
  if you're sure a package manager is not already
  running, you can remove /var/lib/pacman/db.lck

and i tried remove rm: cannot remove /var/lib/pacman/db.lck
but

rm: cannot remove './var/lib/pacman/db.lck': No such file or directory

Offline

#2 2023-03-10 04:02:02

mpan
Member
Registered: 2012-08-01
Posts: 1,321
Website

Re: pacman error : failed to synchronize all databases

Look carefully at the beginning of the path indicated in the error message and the path you are trying to remove. They are not the same.


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#3 2023-03-10 08:23:16

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,090
Website

Re: pacman error : failed to synchronize all databases

mpan wrote:

Look carefully at the beginning of the path indicated in the error message and the path you are trying to remove. They are not the same.

Unless $PWD is /
SCNR


Inofficial first vice preseident of the Rust Evangelism Strike Force

Offline

#4 2023-03-10 12:03:51

mpan
Member
Registered: 2012-08-01
Posts: 1,321
Website

Re: pacman error : failed to synchronize all databases

Haha! big_smile


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#5 2023-03-11 05:47:27

GENgreen
Member
Registered: 2023-02-17
Posts: 14

Re: pacman error : failed to synchronize all databases

schard wrote:
mpan wrote:

Look carefully at the beginning of the path indicated in the error message and the path you are trying to remove. They are not the same.

Unless $PWD is /
SCNR

sorry
i don't know exactly how to do it
is like that ?

pwd
/home/s

Offline

#6 2023-03-11 07:44:30

seth
Member
Registered: 2012-09-03
Posts: 57,455

Re: pacman error : failed to synchronize all databases

You can ignore schard's and mpan's nerd-banter, focus on what mpan wrote in #2

Offline

#7 2023-03-11 14:56:52

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,099

Re: pacman error : failed to synchronize all databases

Stronger hint.   The path you typed is a relative path.  You need an absolute path like the one in the error message.

Also,  please explain why you are using -yy in your pacman invocation instead of -y  (hint: It is probably the True Origin™ of your original problem)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#8 2023-03-12 04:01:50

GENgreen
Member
Registered: 2023-02-17
Posts: 14

Re: pacman error : failed to synchronize all databases

ewaller wrote:

Stronger hint.   The path you typed is a relative path.  You need an absolute path like the one in the error message.

Also,  please explain why you are using -yy in your pacman invocation instead of -y  (hint: It is probably the True Origin™ of your original problem)

Because there have been frequent network problems in the past few months
and need to wait a long time for repair
so use -yy because i don't when network problems and can't update

Offline

#9 2023-03-12 06:55:50

seth
Member
Registered: 2012-09-03
Posts: 57,455

Re: pacman error : failed to synchronize all databases

Were you able to fix your original problem along mpan's hint and ewaller's explanation?

Offline

#10 2023-03-12 16:49:48

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,099

Re: pacman error : failed to synchronize all databases

GENgreen wrote:

Because there have been frequent network problems in the past few months
and need to wait a long time for repair
so use -yy because i don't when network problems and can't update

That makes no sense.  You have network problems, but you use -yy to force pacman do re-download everything over a dodgy network while abusing the servers by using excessive bandwidth.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#11 2023-03-12 17:17:14

seth
Member
Registered: 2012-09-03
Posts: 57,455

Re: pacman error : failed to synchronize all databases

Afaiu

so use -yy because i don't when network problems and can't update

the OP trashed their database w/ a corrupted update and seeks to fix that w/ -yy
Whether or not that's required in the specific situation is a different matter - not sure how network issues would result in a stale /var/lib/pacman/db.lck
Unless the "network" is the electric grid…

Offline

#12 2023-03-13 05:47:21

GENgreen
Member
Registered: 2023-02-17
Posts: 14

Re: pacman error : failed to synchronize all databases

Great, now i know why this things happen
I won't be like this next time

So is there any good solution to this problem

Offline

#13 2023-03-13 06:58:19

seth
Member
Registered: 2012-09-03
Posts: 57,455

Re: pacman error : failed to synchronize all databases

Solution to what problem?
You "network" isssues? Switch to the secondworst ISP in your area?

The original problem of this thread?
mpan hinted at out your mistake and ewaller has explained it.

Offline

#14 2023-03-14 05:29:28

GENgreen
Member
Registered: 2023-02-17
Posts: 14

Re: pacman error : failed to synchronize all databases

seth wrote:

Solution to what problem?
You "network" isssues? Switch to the secondworst ISP in your area?

The original problem of this thread?
mpan hinted at out your mistake and ewaller has explained it.

thanks
let me try it

Offline

#15 2024-08-22 17:19:58

catcattycat
Member
Registered: 2024-04-16
Posts: 16

Re: pacman error : failed to synchronize all databases

My experience asking for support in these forums has been excellent (thank you seth!) so this thread really surprises me.

The help GENgreen received on this post sucks. Vague hints, unclear answers, unhelpful banter, interrogating questions, replies that shame someone clearly inexperienced just trying to use their computer.

From a forum admin and 10+ year old member, no less. If anything turns people off using linux, it's this.

I say this not to blame anyone, but as a reminder that people asking for help here probably aren't experts, mean well, and are doing their best. Clear answers help more than hints; steps on what to do help more than just saying the wrong thing is being done.

Based on what I understand:
- /var/lib/pacman/db.lck is created to ensure that only one update is running at a time
- Normally it's created at the start of an update and removed once the update finishes - it still being present indicates an update didn't complete successfully
- Deleting the lock file (sudo rm /var/lib/pacman/db.lck) and retrying the update will hopefully allow future updates to go through, but there might be some deeper problem that needs resolving

Also, the '.' at the start of ./var/lib/pacman/db.lck indicates a path relative to the current directory. /var/lib/pacman/db.lck, without the '.', indicates an absolute path. They're only equal when your current directory is /. It's usually not, so the desired path is the one without the '.'.

Last edited by catcattycat (2024-08-22 17:24:48)

Offline

#16 2024-08-22 18:53:10

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,341
Website

Re: pacman error : failed to synchronize all databases

Arch is not a distribution for people who need spoon-fed information, especially not the basics. To quote the main website:

https://archlinux.org/about/ wrote:

Arch Linux is a versatile, and simple distribution designed to fit the needs of the competent Linux® user.

Nothing in the responses within this thread was delivered in a way to discourage the OP, but rather steer them towards learning the answers for themselves. This is how the Arch community works.

That being said, please do not necrobump.

https://wiki.archlinux.org/title/Genera … bumping%22

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB