Database sync pacman error

Error: failed to synchronize databases (unable to lock database)

Hello everyone, I’m having an issue while trying to update my system.

(pacman ,yay ,cachy update)

Note: I do not have any active pacman instance and I do not intend to delete db.lck

sys info

**System:** 
  **Kernel:** 6.16.8-2-cachyos **arch:** x86_64 **bits:** 64 **compiler:** clang **v:** 20.1.8 
    **clocksource:** tsc **avail:** hpet,acpi_pm 
    **parameters:** BOOT_IMAGE=/@/boot/vmlinuz-linux-cachyos 
    root=UUID=a2056dd7-7ad3-42a8-acb7-a9af2c43b824 rw rootflags=subvol=@ 
    nowatchdog nvme_load=YES zswap.enabled=0 splash 
    resume=UUID=a76a1ed0-6d1a-4eee-bb0c-b5831eb2f786 loglevel=3 
  **Desktop:** KDE Plasma **v:** 6.4.5 **tk:** Qt **v:** N/A **info:** frameworks **v:** 6.18.0 
    **wm:** kwin_wayland **vt:** 2 **dm:** SDDM **Distro:** CachyOS **base:** Arch Linux 
**Machine:** 
  **Type:** Desktop **System:** BIOSTAR **product:** H410MH **v:** N/A 
    **serial:** <superuser required> **Chassis:** **type:** 3 **serial:** <superuser required> 
  **Mobo:** BIOSTAR **model:** H410MH **serial:** <superuser required> 
    **uuid:** <superuser required> **UEFI:** American Megatrends **v:** 5.17 
    **date:** 12/17/2020 
**Battery:** 
  **Device-1:** hidpp_battery_0 **model:** Logitech Wireless Keyboard **serial:** <filter> 
    **charge:** 55% (should be ignored) **rechargeable:** yes **status:** discharging 
**CPU:** 
  **Info:** **model:** Intel Core i5-10400F **bits:** 64 **type:** MT MCP **arch:** Comet Lake 
    **gen:** core 10 **level:** v3 **note:** check **built:** 2020 **process:** Intel 14nm **family:** 6 
    **model-id:** 0xA5 (165) **stepping:** 3 **microcode:** 0x100 
  **Topology:** **cpus:** 1x **dies:** 1 **clusters:** 6 **cores:** 6 **threads:** 12 **tpc:** 2 
    **smt:** enabled **cache:** **L1:** 384 KiB **desc:** d-6x32 KiB; i-6x32 KiB **L2:** 1.5 MiB 
    **desc:** 6x256 KiB **L3:** 12 MiB **desc:** 1x12 MiB 
  **Speed (MHz):** **avg:** 800 **min/max:** 800/2900 **scaling:** **driver:** intel_pstate 
    **governor:** powersave **cores:** **1:** 800 **2:** 800 **3:** 800 **4:** 800 **5:** 800 **6:** 800 **7:** 800 
    **8:** 800 **9:** 800 **10:** 800 **11:** 800 **12:** 800 **bogomips:** 69597 
  **Flags-basic:** avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  **Vulnerabilities:** 
  **Type:** gather_data_sampling **mitigation:** Microcode 
  **Type:** ghostwrite **status:** Not affected 
  **Type:** indirect_target_selection **mitigation:** Aligned branch/return thunks 
  **Type:** itlb_multihit **status:** KVM: Split huge pages 
  **Type:** l1tf **status:** Not affected 
  **Type:** mds **status:** Not affected 
  **Type:** meltdown **status:** Not affected 
  **Type:** mmio_stale_data **mitigation:** Clear CPU buffers; SMT vulnerable 
  **Type:** old_microcode **status:** Not affected 
  **Type:** reg_file_data_sampling **status:** Not affected 
  **Type:** retbleed **mitigation:** Enhanced IBRS 
  **Type:** spec_rstack_overflow **status:** Not affected 
  **Type:** spec_store_bypass **mitigation:** Speculative Store Bypass disabled via 
    prctl 
  **Type:** spectre_v1 **mitigation:** usercopy/swapgs barriers and \__user pointer 
    sanitization 
  **Type:** spectre_v2 **mitigation:** Enhanced / Automatic IBRS; IBPB: 
    conditional; PBRSB-eIBRS: SW sequence; BHI: SW loop, KVM: SW loop 
  **Type:** srbds **mitigation:** Microcode 
  **Type:** tsa **status:** Not affected 
  **Type:** tsx_async_abort **status:** Not affected 
  **Type:** vmscape **mitigation:** IBPB before exit to userspace 
**Graphics:** 
  **Device-1:** NVIDIA GA106 \[Geforce RTX 3050\] **driver:** nvidia **v:** 580.82.09 
    **alternate:** nouveau,nvidia_drm **non-free:** 550-580.xx+ **status:** current (as of 
    2025-08; EOL\~2026-12-xx) **arch:** Ampere **code:** GAxxx **process:** TSMC n7 (7nm) 
    **built:** 2020-2023 **pcie:** **gen:** 3 **speed:** 8 GT/s **lanes:** 8 **link-max:** **gen:** 4 
    **speed:** 16 GT/s **lanes:** 16 **ports:** **active:** DP-1 **empty:** DP-2,DP-3,HDMI-A-1 
    **bus-ID:** 01:00.0 **chip-ID:** 10de:2507 **class-ID:** 0300 
  **Display:** wayland **server:** X.org **v:** 1.21.1.18 **with:** Xwayland **v:** 24.1.8 
    **compositor:** kwin_wayland **driver:** **X:** **loaded:** nvidia **unloaded:** modesetting 
    **alternate:** fbdev,nouveau,nv,vesa **gpu:** nv_platform,nvidia,nvidia-nvswitch 
    **display-ID:** 0 
  **Monitor-1:** DP-1 **model:** SFP3212FHD **serial:** <filter> **built:** 2022 **res:** 
    **mode:** 1920x1080 **hz:** 165 **scale:** 100% (1) **dpi:** 70 **gamma:** 1.2 
    **size:** 600x330mm (23.62x12.99") **diag:** 801mm (31.5") **ratio:** 16:9 **modes:** 
    **max:** 1920x1080 **min:** 640x480 
  **API:** EGL **v:** 1.5 **hw:** **drv:** nvidia **platforms:** **device:** 0 **drv:** nvidia **device:** 2 
    **drv:** swrast **gbm:** **drv:** nvidia **surfaceless:** **drv:** nvidia **wayland:** **drv:** nvidia 
    **x11:** **drv:** nvidia **inactive:** device-1 
  **API:** OpenGL **v:** 4.6.0 **compat-v:** 4.5 **vendor:** nvidia mesa **v:** 580.82.09 
    **glx-v:** 1.4 **direct-render:** yes **renderer:** NVIDIA GeForce RTX 3050/PCIe/SSE2 
    **memory:** 7.81 GiB **display-ID:** :0.0 
  **API:** Vulkan **v:** 1.4.321 **layers:** 10 **device:** 0 **type:** discrete-gpu 
    **name:** NVIDIA GeForce RTX 3050 **driver:** nvidia **v:** 580.82.09 
    **device-ID:** 10de:2507 **surfaces:** N/A 
  **Info:** **Tools:** **api:** clinfo, eglinfo, glxinfo, vulkaninfo 
    **de:** kscreen-console,kscreen-doctor **gpu:** nvidia-settings,nvidia-smi 
    **wl:** wayland-info **x11:** xdpyinfo, xprop, xrandr 
**Audio:** 
  **Device-1:** Intel Comet Lake PCH-V cAVS **vendor:** Biostar Microtech Intl Corp 
    **driver:** snd_hda_intel **v:** kernel **alternate:** snd_soc_avs,snd_sof_pci_intel_cnl 
    **bus-ID:** 00:1f.3 **chip-ID:** 8086:a3f0 **class-ID:** 0403 
  **Device-2:** NVIDIA GA106 High Definition Audio **driver:** snd_hda_intel 
    **v:** kernel **pcie:** **gen:** 3 **speed:** 8 GT/s **lanes:** 8 **link-max:** **gen:** 4 
    **speed:** 16 GT/s **lanes:** 16 **bus-ID:** 01:00.1 **chip-ID:** 10de:228e **class-ID:** 0403 
  **Device-3:** Sony Wireless Headset **driver:** hid-generic,snd-usb-audio,usbhid 
    **type:** USB **rev:** 1.1 **speed:** 12 Mb/s **lanes:** 1 **mode:** 1.1 **bus-ID:** 1-6:6 
    **chip-ID:** 054c:0d5e **class-ID:** 0300 
  **API:** ALSA **v:** k6.16.8-2-cachyos **status:** kernel-api 
    **tools:** alsactl,alsamixer,amixer 
  **Server-1:** sndiod **v:** N/A **status:** off **tools:** aucat,midicat,sndioctl 
  **Server-2:** JACK **v:** 1.9.22 **status:** off **tools:** N/A 
  **Server-3:** PipeWire **v:** 1.4.8 **status:** active **with:** **1:** pipewire-pulse 
    **status:** active **2:** wireplumber **status:** active **3:** pipewire-alsa **type:** plugin 
    **tools:** pactl,pw-cat,pw-cli,wpctl 
**Network:** 
  **Device-1:** Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet 
    **vendor:** Biostar Microtech Intl Corp **driver:** r8169 **v:** kernel **pcie:** **gen:** 1 
    **speed:** 2.5 GT/s **lanes:** 1 **port:** 3000 **bus-ID:** 02:00.0 **chip-ID:** 10ec:8168 
    **class-ID:** 0200 
  **IF:** enp2s0 **state:** down **mac:** <filter> 
  **Device-2:** Realtek RTL8188EUS 802.11n Wireless Network Adapter 
    **driver:** rtl8xxxu **type:** USB **rev:** 2.0 **speed:** 480 Mb/s **lanes:** 1 **mode:** 2.0 
    **bus-ID:** 1-3:4 **chip-ID:** 0bda:8179 **class-ID:** 0000 **serial:** <filter> 
  **IF:** wlan0 **state:** up **mac:** <filter> 
  **Device-3:** Sony Wireless Headset **driver:** hid-generic,snd-usb-audio,usbhid 
    **type:** USB **rev:** 1.1 **speed:** 12 Mb/s **lanes:** 1 **mode:** 1.1 **bus-ID:** 1-6:6 
    **chip-ID:** 054c:0d5e **class-ID:** 0300 
  **Info:** **services:** NetworkManager, systemd-timesyncd, wpa_supplicant 
**Drives:** 
  **Local Storage:** **total:** 2.78 TiB **used:** 844.6 GiB (29.7%) 
  **SMART Message:** Unable to run smartctl. Root privileges required. 
  **ID-1:** /dev/nvme0n1 **maj-min:** 259:0 **vendor:** Kingston **model:** SKC3000D2048G 
    **size:** 1.86 TiB **block-size:** **physical:** 512 B **logical:** 512 B **speed:** 63.2 Gb/s 
    **lanes:** 4 **tech:** SSD **serial:** <filter> **fw-rev:** EIFK31.7 **temp:** 20.9 C 
    **scheme:** GPT 
  **ID-2:** /dev/sda **maj-min:** 8:0 **vendor:** Samsung **model:** GN-SSD-SH 1TB 
    **size:** 931.51 GiB **block-size:** **physical:** 512 B **logical:** 512 B **speed:** 6.0 Gb/s 
    **tech:** SSD **serial:** <filter> **fw-rev:** 2B0 **scheme:** GPT 
  **ID-3:** /dev/sdb **maj-min:** 8:16 **model:** USB DISK 2.0 **size:** 7.24 GiB 
    **block-size:** **physical:** 512 B **logical:** 512 B **type:** USB **rev:** 2.0 **spd:** 480 Mb/s 
    **lanes:** 1 **mode:** 2.0 **tech:** N/A **serial:** <filter> **fw-rev:** PMAP **scheme:** GPT 
  **SMART Message:** Unknown USB bridge. Flash drive/Unsupported enclosure? 
**Partition:** 
  **ID-1:** / **raw-size:** 600 GiB **size:** 600 GiB (100.00%) **used:** 164.91 GiB (27.5%) 
    **fs:** btrfs **dev:** /dev/nvme0n1p5 **maj-min:** 259:5 
  **ID-2:** /boot/efi **raw-size:** 337.6 MiB **size:** 336.2 MiB (99.60%) 
    **used:** 37.9 MiB (11.3%) **fs:** vfat **dev:** /dev/nvme0n1p1 **maj-min:** 259:1 
  **ID-3:** /home **raw-size:** 600 GiB **size:** 600 GiB (100.00%) 
    **used:** 164.91 GiB (27.5%) **fs:** btrfs **dev:** /dev/nvme0n1p5 **maj-min:** 259:5 
  **ID-4:** /var/log **raw-size:** 600 GiB **size:** 600 GiB (100.00%) 
    **used:** 164.91 GiB (27.5%) **fs:** btrfs **dev:** /dev/nvme0n1p5 **maj-min:** 259:5 
  **ID-5:** /var/tmp **raw-size:** 600 GiB **size:** 600 GiB (100.00%) 
    **used:** 164.91 GiB (27.5%) **fs:** btrfs **dev:** /dev/nvme0n1p5 **maj-min:** 259:5 
**Swap:** 
  **Kernel:** **swappiness:** 150 (default 60) **cache-pressure:** 50 (default 100) 
    **zswap:** no 
  **ID-1:** swap-1 **type:** zram **size:** 15.54 GiB **used:** 0 KiB (0.0%) **priority:** 100 
    **comp:** zstd **avail:** lzo-rle,lzo,lz4,lz4hc,deflate,842 **dev:** /dev/zram0 
  **ID-2:** swap-2 **type:** partition **size:** 16 GiB **used:** 0 KiB (0.0%) **priority:** -2 
    **dev:** /dev/nvme0n1p6 **maj-min:** 259:6 
**Sensors:** 
  **System Temperatures:** **cpu:** 28.0 C **mobo:** N/A 
  **Fan Speeds (rpm):** N/A 
**Info:** 
  **Memory:** **total:** 16 GiB **available:** 15.54 GiB **used:** 4.65 GiB (29.9%) 
  **Processes:** 335 **Power:** **uptime:** 27m **states:** freeze,mem,disk **suspend:** deep 
    **avail:** s2idle **wakeups:** 0 **hibernate:** platform **avail:** shutdown, reboot, 
    suspend, test_resume **image:** 6.13 GiB **services:** org_kde_powerdevil, 
    power-profiles-daemon, upowerd **Init:** systemd **v:** 258 **default:** graphical 
    **tool:** systemctl 
  **Packages:** 1641 **pm:** pacman **pkgs:** 1583 **libs:** 483 **tools:** octopi,paru,yay 
    **pm:** flatpak **pkgs:** 58 **Compilers:** **clang:** 20.1.8 **gcc:** 15.2.1 **Shell:** fish 
    **v:** 4.0.8 **running-in:** konsole **inxi:** 3.3.39

image:

Since your screen capture is not in my native language, I’m guessing to some degree, but I suspect just remove your lock file and go to town updating.

Are you sure no other update or package exchange process is running?

Maybe restart to be double sure and also make sure to stop any ‘automatic update’ or checker or similar.

Then try again, ex;

sudo pacman -Syu

You can also run the following to see if any process is using the lock file;

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

If none is then you may safely remove it;

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

And retry;

sudo pacman -Syu

ps aux | grep pacman

miguel 10735 0.0 0.0 7112 4328 pts/1 S<+ 19:27 0:00 grep --color=auto pacman

sudo pacman -Syu
[sudo] senha para miguel:
:: Sincronizando a base de dados de pacotes…
erro: falha ao sincronizar todas as bases de dados (não foi possível travar a base de dados)

What about the other steps?

I understood and followed the steps ( worked ), but is there no other way to do this?

Did removing the lock file not allow for return to normal operation?

I suppose removing the lock could be done using some other approach .. but sudo rm /var/lib/pacman/db.lck is probably the most direct.

It worked and didn’t affect me, but when I update and open another pacman it can corrupt

The point of the lock file is to attempt and stop you from doing that.

You should not be consciously trying to use multiple pacman processes concurrently.

( Or update and install new packages in different windows at the same time or similar. )

I know that’s why I didn’t want to delete the file, the problem is that there was nothing open and it said that there was another one open

You earlier made mention of “cachy update” which I take to mean the recently made fork of arch-update .. this notifier would be performing various pacman functions and might be the other process you were not accounting for.

I wouldnt know for sure. I dont use anything like it. But then I never get those kinds of errors either. :wink:

I use several commands to check if there are open instances, but none of them showed any instances.

Maybe not in that final moment .. but it was created and left possibly by previous activity like that mentioned above.

Anyways mYbe keep an eye on it and you can find some common cause.

The system does not check the list of processes. It only checks, if the lock file is present. If it is, the system assumes that another instance is running. This assumption might be normally sufficient, but if the file is present for some other reason than an instance running (e.g. failed deletion after update, hard shutdown, etc.) , the check fails and you’re stuck. In these cases you need to delete the file manually.

Thanks. This was quite helpful. :blush:

Helpful for me too. Xtra THX for explaining.