The db could not be synchronisized :: the system was not able to lock the db

hello dear friends,

on my notebook i tried to update the whole thing - i found out that the db - synchronisation did not work

Arch & EndeavourOS Update-Check:
:: Suche Arch & EndeavourOS nach Updates...
archlinux-keyring 20220713-1 -> 20220727-1
base 2-2 -> 3-1
cryptsetup 2.4.3-2 -> 2.5.0-1
eos-bash-shared 1.24-1 -> 1.25-1
eos-rankmirrors 2.2.7-1 -> 2.3-1
eos-translations 1.7-1 -> 1.9-1
firefox 102.0.1-1 -> 103.0-1
gsm 1.0.19-1 -> 1.0.20-1
harfbuzz 4.4.1-1 -> 5.0.1-1
harfbuzz-icu 4.4.1-1 -> 5.0.1-1
hwloc 2.7.1-1 -> 2.8.0-1
imagemagick 7.1.0.43-1 -> 7.1.0.44-1
inxi 3.3.19.1-1 -> 3.3.20.1-1
iso-codes 4.10.0-1 -> 4.11.0-1
ldb 2:2.5.1-1 -> 2:2.5.2-1
libcap 2.64-1 -> 2.65-1
libmm-glib 1.18.10-1 -> 1.18.10-2
libspiro 1:20200505-2 -> 1:20220722-1
libuv 1.43.0-1 -> 1.44.2-1
linux 5.18.14.arch1-1 -> 5.18.15.arch1-1
linux-headers 5.18.14.arch1-1 -> 5.18.15.arch1-1
llvm-libs 14.0.6-1 -> 14.0.6-2
lv2 1.18.4-2 -> 1.18.6-1
mesa 22.1.3-1 -> 22.1.4-1
mobile-broadband-provider-info 20220511-1 -> 20220725-1
modemmanager 1.18.10-1 -> 1.18.10-2
pacman 6.0.1-5 -> 6.0.1-7
parallel 20220622-1 -> 20220722-1
qt5-base 5.15.5+kde+r172-1 -> 5.15.5+kde+r174-1
serd 0.30.12-2 -> 0.30.14-1
smbclient 4.16.3-1 -> 4.16.4-1
sord 0.16.10-2 -> 0.16.12-3
sratom 0.6.10-3 -> 0.6.12-1
webkit2gtk 2.36.4-2 -> 2.36.5-1
Root Passwort: 
:: Paketdatenbanken werden synchronisiert …
**Fehler**: Keine Datenbank konnte synchronisiert werden (Kann Datenbank nicht sperren)

which means : the db could not be synchronisized - - the system was not able to lock the db

on a sidnote-; how to switch the terminal to give out the eng. language!?

love to hear from you

Please see:

https://wiki.archlinux.org/title/Pacman#"Failed_to_init_transaction_(unable_to_lock_database)"_error

Put LANG=C before the command you are running.

EX:

LANG=C sudo pacman -Syu
3 Likes

hi there - good day. Many thanks for the quick reply and for the hints.

:: Paketdatenbanken werden synchronisiert …
Fehler: Keine Datenbank konnte synchronisiert werden (Kann Datenbank nicht sperren)

AUR Update-Check:
:: Durchsuche AUR nach Updates...
:: 1 Pakete zu aktualisieren.
1  aur/celt  0.11.3-4 -> 0.11.3-5
==> Pakete zum AusschlieĂźen: (z.B. "1 2 3", "1-3", "^4" oder Repo-Name)
==>  rm /var/lib/pacman/db.lck
:: Prüfe auf mögliche Konflikte...
:: Prüfe auf mögliche interne Konflikte...
[Aur:1]  celt-0.11.3-5

  1 celt                             (Installiert) (Build-Dateien sind vorhanden)
==> Pakete fĂĽr neuen Build?
==> [N] Keine [A]lle [Ab]brechen [I]nstalliert [No]nicht installiert oder (1 2 3, 1-3, ^4)
==>

hmm - i guess that i have overseen some things in the above mentioned data…

note - now i want to take care for the lang-switching…

Fehler: Keine Datenbank konnte synchronisiert werden (Kann Datenbank nicht sperren)

Same issue.

The solution is still the same expressed in the link I posted before.

2 Likes

Can you share the full output from LANG=C sudo pacman -Syu instead of the tool you are using to update?

1 Like

hi and good day dear Dalto - many thanks for the quick reply


AUR Update-Check:
:: Durchsuche AUR nach Updates...
:: 1 Pakete zu aktualisieren.
1  aur/celt  0.11.3-4 -> 0.11.3-5
==> Pakete zum AusschlieĂźen: (z.B. "1 2 3", "1-3", "^4" oder Repo-Name)
==>  rm /var/lib/pacman/db.lck
:: Prüfe auf mögliche Konflikte...
:: Prüfe auf mögliche interne Konflikte...
[Aur:1]  celt-0.11.3-5

  1 celt                             (Installiert) (Build-Dateien sind vorhanden)
==> Pakete fĂĽr neuen Build?
==> [N] Keine [A]lle [Ab]brechen [I]nstalliert [No]nicht installiert oder (1 2 3, 1-3, ^4)
==> LANG=C sudo pacman
:: PKGBUILD aktuell, ĂĽberspringe (1/0): celt
  1 celt                             (Installiert) (Build-Dateien sind vorhanden)
==> Diffs zeigen?
==> [N] Keine [A]lle [Ab]brechen [I]nstalliert [No]nicht installiert oder (1 2 3, 1-3, ^4)
==>

i am willing to follow your recommendations - but evey time i enter the command to switch the terminal - lang - then i get some replies as mentioned above

do i something wrong - srry - if so. I am willing to work on the solution…!!!

Please show us also the command you have used.

1 Like

Try updating your repo packages first to see if the db.lck issue is still there.

Open a terminal and copy and paste the following:

LANG=C sudo pacman -Syu

press enter.

Type in your password and press enter again.

Post the whole of the output in your reply.

1 Like

You need to be at the prompt before you type the command. It probably ends with $. You can’t type commands from inside your AUR update.

1 Like

hello and good day dear Dalto

many thanks for the quick reply. Great to hear from you

see here

[martin@martineos ~]$ LANG=C sudo pacman -Syu
[sudo] password for martin: 
:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
[martin@martineos ~]$ LANG=C sudo pacman -Syu
:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
[martin@martineos ~]$

look forward to hear from you

First make sure no other instance of package manager is running on your system:

LANG=C sudo fuser /var/lib/pacman/db.lck

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

Then run again:

LANG=C sudo pacman -Syu

1 Like

hi pebcak hi pycrk
first of all : many many thanks for the quick reply - i am very glad.
now it runs - i did all - i entered all the commands you gave.
BTW: i runned into these kinds of errors some times -(repeadedly) i now have to digg deeper into the backgrounds - in order to learn what stops me …

pebcak mentioned above this link
https://wiki.archlinux.org/title/Pacman#“Failed_to_init_transaction_(unable_to_lock_database)”_error

update_ now the full update was possible all runned nicely - and i am glad

see the full list - what happened:

and yes - now i have to digg deeper to see what are my issues - /(that i am struggling so often with)…

now the system recommends the reboot - due to the update of the core system packages

:upside_down_face: :grinning:

update 2

see what is my main problem - see what causes soooo many issues - this is the issue i am struggling for so many times. I HAVE to get the fix - that helps me to go rund this issue.

:: Synchronizing package databases...
error: failed to synchronize all databases (unable to lock database)
[martin@martineos ~]$ sudo fuser /var/lib/pacman/db.lck
[sudo] Passwort fĂĽr martin: 
[martin@martineos ~]$ sudo rm /var/lib/pacman/db.lck

if i know what helps here - then i will get more confident to use EndeavourOS

btw: later the day i am installing a fresh EndeavourOS on the Notebook of my girlfriend.
I need to get more insights into the issues - so that i do not run into the db-locks in the next times… :upside_down_face: :slightly_smiling_face:

update:4
the fix might be this here - the solution - i guess that these lines represent the solution for my issues… - in other words - if it comes to eerors with the db (if this is locked) then i have to look at the following lines

pebcak: mentioned:

First make sure no other instance of package manager is running on your system:

LANG=C sudo fuser /var/lib/pacman/db.lck

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

Then run again:

LANG=C sudo pacman -Syu

this i will learn by heart - this seems to be the solution :upside_down_face: :slightly_smiling_face: