Pacman failed to initialize alpm library

Hello,

I guess my pacman is in need of some fixing and maybe someone can help me with this?

I can install packages just fine but in case I want to remove one (say just for example with sudo pacman -r vulkan-mesa-layers) I got this one (translated from german):

error: failed to initialize alpm library
(root: mesa-vulkan-layers, dbpath: mesa-vulkan-layers/var/lib/pacman/)
could not find or read directory

I have tried to look deeper with

$ pacman -V
Pacman v6.0.1 - libalpm v13.0.1
$ ldd /usr/bin/pacman
        linux-vdso.so.1 (0x00007ffcb7996000)
        libalpm.so.13 => /usr/lib/libalpm.so.13 (0x00007f4af8d17000)
        libarchive.so.13 => /usr/lib/libarchive.so.13 (0x00007f4af8c54000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f4af8a88000)
        libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007f4af87a7000)
        libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007f4af8707000)
        libgpgme.so.11 => /usr/lib/libgpgme.so.11 (0x00007f4af86b6000)
        libacl.so.1 => /usr/lib/libacl.so.1 (0x00007f4af86a9000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f4af8679000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f4af8650000)
        libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f4af8579000)
        liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f4af8556000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f4af8543000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007f4af8527000)
        /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f4af8da2000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f4af8520000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f4af84ff000)
        libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x00007f4af84d3000)
        libidn2.so.0 => /usr/lib/libidn2.so.0 (0x00007f4af84b1000)
        libssh2.so.1 => /usr/lib/libssh2.so.1 (0x00007f4af8470000)
        libpsl.so.5 => /usr/lib/libpsl.so.5 (0x00007f4af845b000)
        libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007f4af83c9000)
        libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007f4af8374000)
        libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x00007f4af8366000)
        libassuan.so.0 => /usr/lib/libassuan.so.0 (0x00007f4af8351000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f4af8329000)
        libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007f4af81a5000)
        libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007f4af80be000)
        libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007f4af808d000)
        libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007f4af8087000)
        libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007f4af8077000)
        libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0x00007f4af806e000)
        libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f4af8054000)
        libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x00007f4af8031000)
$ ll /usr/lib64/libalpm.so.13.0.1   
-rwxr-xr-x 1 root root 243608 15. Sep 15:38 /usr/lib64/libalpm.so.13.0.1
$ pacman -v
Root      : /
Conf File : /etc/pacman.conf
DB Path   : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/  
Hook Dirs : /usr/share/libalpm/hooks/  /etc/pacman.d/hooks/  
Lock File : /var/lib/pacman/db.lck
Log File  : /var/log/pacman.log
GPG Dir   : /etc/pacman.d/gnupg/

So far I guess everything is fine. Now:

$sudo pacman -Sy --debug
debug: pacman v6.0.1 - libalpm v13.0.1
debug: config: attempting to read file /etc/pacman.conf
debug: config: new section 'options'
debug: config: HoldPkg: pacman
debug: config: HoldPkg: glibc
debug: config: Architecture: auto
debug: config: arch: x86_64
debug: config: chomp
debug: config: verbosepkglists
debug: config: SigLevel: Required
debug: config: SigLevel: DatabaseOptional
debug: config: LocalFileSigLevel: Optional
debug: config: new section 'core'
debug: config file /etc/pacman.conf, line 79: including /etc/pacman.d/mirrorlist
debug: config: new section 'extra'
debug: config file /etc/pacman.conf, line 82: including /etc/pacman.d/mirrorlist
debug: config: new section 'community'
debug: config file /etc/pacman.conf, line 88: including /etc/pacman.d/mirrorlist
debug: config: new section 'multilib'
debug: config file /etc/pacman.conf, line 97: including /etc/pacman.d/mirrorlist
debug: config: new section 'endeavouros'
debug: config: SigLevel: PackageRequired
debug: config file /etc/pacman.conf, line 101: including /etc/pacman.d/endeavouros-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.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: setting usage of 15 for core repository
debug: adding new server URL to database 'core': https://mirrors.xtom.de/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://arch.jensgutermuth.de/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.pkgbuild.com/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.f4st.host/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.moson.org/arch/core/os/x86_64
debug: adding new server URL to database 'core': https://pkg.fef.moe/archlinux/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.chaoticum.net/arch/core/os/x86_64
debug: adding new server URL to database 'core': https://phinau.de/arch/core/os/x86_64
debug: adding new server URL to database 'core': https://mirror.pseudoform.org/core/os/x86_64
debug: adding new server URL to database 'core': https://archlinux.thaller.ws/core/os/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.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: setting usage of 15 for extra repository
debug: adding new server URL to database 'extra': https://mirrors.xtom.de/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://arch.jensgutermuth.de/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.pkgbuild.com/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.f4st.host/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.moson.org/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': https://pkg.fef.moe/archlinux/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.chaoticum.net/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': https://phinau.de/arch/extra/os/x86_64
debug: adding new server URL to database 'extra': https://mirror.pseudoform.org/extra/os/x86_64
debug: adding new server URL to database 'extra': https://archlinux.thaller.ws/extra/os/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.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/community.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: setting usage of 15 for community repository
debug: adding new server URL to database 'community': https://mirrors.xtom.de/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': https://arch.jensgutermuth.de/community/os/x86_64
debug: adding new server URL to database 'community': https://mirror.pkgbuild.com/community/os/x86_64
debug: adding new server URL to database 'community': https://mirror.f4st.host/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': https://mirror.moson.org/arch/community/os/x86_64
debug: adding new server URL to database 'community': https://pkg.fef.moe/archlinux/community/os/x86_64
debug: adding new server URL to database 'community': https://mirror.chaoticum.net/arch/community/os/x86_64
debug: adding new server URL to database 'community': https://phinau.de/arch/community/os/x86_64
debug: adding new server URL to database 'community': https://mirror.pseudoform.org/community/os/x86_64
debug: adding new server URL to database 'community': https://archlinux.thaller.ws/community/os/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.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/multilib.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: setting usage of 15 for multilib repository
debug: adding new server URL to database 'multilib': https://mirrors.xtom.de/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://arch.jensgutermuth.de/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.pkgbuild.com/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.f4st.host/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.moson.org/arch/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://pkg.fef.moe/archlinux/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.chaoticum.net/arch/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://phinau.de/arch/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://mirror.pseudoform.org/multilib/os/x86_64
debug: adding new server URL to database 'multilib': https://archlinux.thaller.ws/multilib/os/x86_64
debug: registering sync database 'endeavouros'
debug: database path for tree endeavouros set to /var/lib/pacman/sync/endeavouros.db
debug: "/var/lib/pacman/sync/endeavouros.db.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/endeavouros.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: setting usage of 15 for endeavouros repository
debug: adding new server URL to database 'endeavouros': https://mirror.alpix.eu/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://de.freedif.org/EndeavourOS/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://mirror.moson.org/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://ftp.acc.umu.se/mirror/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://mirror.linux.pizza/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://ca.gate.endeavouros.com/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://mirrors.tuna.tsinghua.edu.cn/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://mirror.jingk.ai/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': http://mirror.jingk.ai/endeavouros/repo/endeavouros/x86_64
debug: adding new server URL to database 'endeavouros': https://endeavour.remi.lu/repo/endeavouros/x86_64
:: Paketdatenbanken werden synchronisiert …
 core wird heruntergeladen …
 extra wird heruntergeladen …
 community wird heruntergeladen …
 multilib wird heruntergeladen …
 endeavouros wird heruntergeladen …
debug: core.db: url is https://mirrors.xtom.de/archlinux/core/os/x86_64/core.db
debug: core.db: maxsize 134217728
debug: core.db: using time condition 1640818161
debug: core.db: opened tempfile for download: /var/lib/pacman/sync/core.db.part (wb)
debug: extra.db: url is https://mirrors.xtom.de/archlinux/extra/os/x86_64/extra.db
debug: extra.db: maxsize 134217728
debug: extra.db: using time condition 1640818167
debug: extra.db: opened tempfile for download: /var/lib/pacman/sync/extra.db.part (wb)
debug: community.db: url is https://mirrors.xtom.de/archlinux/community/os/x86_64/community.db
debug: community.db: maxsize 134217728
debug: community.db: using time condition 1640823697
debug: community.db: opened tempfile for download: /var/lib/pacman/sync/community.db.part (wb)
debug: multilib.db: url is https://mirrors.xtom.de/archlinux/multilib/os/x86_64/multilib.db
debug: multilib.db: maxsize 134217728
debug: multilib.db: using time condition 1640808188
debug: multilib.db: opened tempfile for download: /var/lib/pacman/sync/multilib.db.part (wb)
debug: endeavouros.db: url is https://mirror.alpix.eu/endeavouros/repo/endeavouros/x86_64/endeavouros.db
debug: endeavouros.db: maxsize 134217728
debug: endeavouros.db: using time condition 1640812202
debug: endeavouros.db: opened tempfile for download: /var/lib/pacman/sync/endeavouros.db.part (wb)
debug: extra.db: curl returned result 0 from transfer
debug: extra.db: response code 304
debug: extra.db.sig: url is https://mirrors.xtom.de/archlinux/extra/os/x86_64/extra.db.sig
debug: extra.db.sig: maxsize 16384
debug: extra.db.sig: opened tempfile for download: /var/lib/pacman/sync/extra.db.sig.part (wb)
debug: extra.db: file met time condition
debug: core.db: curl returned result 0 from transfer
debug: core.db: response code 304
debug: core.db.sig: url is https://mirrors.xtom.de/archlinux/core/os/x86_64/core.db.sig
debug: core.db.sig: maxsize 16384
debug: core.db.sig: opened tempfile for download: /var/lib/pacman/sync/core.db.sig.part (wb)
debug: core.db: file met time condition
debug: community.db: curl returned result 0 from transfer
debug: community.db: response code 304
debug: community.db.sig: url is https://mirrors.xtom.de/archlinux/community/os/x86_64/community.db.sig
debug: community.db.sig: maxsize 16384
debug: community.db.sig: opened tempfile for download: /var/lib/pacman/sync/community.db.sig.part (wb)
debug: community.db: file met time condition
debug: multilib.db: curl returned result 0 from transfer
debug: multilib.db: response code 304
debug: multilib.db.sig: url is https://mirrors.xtom.de/archlinux/multilib/os/x86_64/multilib.db.sig
debug: multilib.db.sig: maxsize 16384
debug: multilib.db.sig: opened tempfile for download: /var/lib/pacman/sync/multilib.db.sig.part (wb)
debug: multilib.db: file met time condition
debug: extra.db.sig: curl returned result 0 from transfer
debug: extra.db.sig: response code 404
debug: extra.db.sig: no more servers to retry
debug: core.db.sig: curl returned result 0 from transfer
debug: core.db.sig: response code 404
debug: core.db.sig: no more servers to retry
debug: community.db.sig: curl returned result 0 from transfer
debug: community.db.sig: response code 404
debug: community.db.sig: no more servers to retry
debug: multilib.db.sig: curl returned result 0 from transfer
debug: multilib.db.sig: response code 404
debug: multilib.db.sig: no more servers to retry
debug: endeavouros.db: curl returned result 0 from transfer
debug: endeavouros.db: response code 304
debug: endeavouros.db.sig: url is https://mirror.alpix.eu/endeavouros/repo/endeavouros/x86_64/endeavouros.db.sig
debug: endeavouros.db.sig: maxsize 16384
debug: endeavouros.db.sig: opened tempfile for download: /var/lib/pacman/sync/endeavouros.db.sig.part (wb)
debug: endeavouros.db: file met time condition
debug: endeavouros.db.sig: curl returned result 0 from transfer
debug: endeavouros.db.sig: response code 404
debug: endeavouros.db.sig: no more servers to retry
debug: curl_download_internal return code is 0
debug: "/var/lib/pacman/sync/core.db.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/core.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: "/var/lib/pacman/sync/extra.db.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/extra.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: "/var/lib/pacman/sync/community.db.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/community.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: "/var/lib/pacman/sync/multilib.db.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/multilib.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: "/var/lib/pacman/sync/endeavouros.db.sig" is not readable: Datei oder Verzeichnis nicht gefunden
debug: sig path /var/lib/pacman/sync/endeavouros.db.sig could not be opened
debug: got error 43 at _alpm_gpgme_checksig (../lib/libalpm/signing.c: 593) : Fehlende PGP-Signatur
debug: missing optional signature
debug: unregistering database 'local'
debug: unregistering database 'core'
debug: unregistering database 'extra'
debug: unregistering database 'community'
debug: unregistering database 'multilib'
debug: unregistering database 'endeavouros'

Sorry for the german parts. As far as I understand I am missing some PGP-signatures, right?
And some files/folders could not be found but maybe this is related to the signatures?

And if so - how can I get these?

I have already tried rebooting and refreshing the mirrors.

Thank you in advance!

pacman -r specifies an alternative root.

To remove a package use pacman -R, it must be uppercase.

5 Likes

This worked. Wow, thank you. So this was the only problem here?

I feel a little bit ashamed. :flushed:

1 Like

I suspect that you received that error because there was no alpm at the alternate root you specified but I am not in front of my machine to test,

I have no alternate root I know of so yes, I guess you are right :slight_smile:

1 Like

You may find this helpful. Spelling, capitolization, punctuation, spaces, literally EVERYTHING matters in Arch/Arch based.

https://wiki.archlinux.org/title/Pacman/Rosetta

2 Likes

I do, thank you very much :slight_smile:
I have now bookmarked this site for further use.

1 Like

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