Skip to content

repositories failed to initialize alpm library #155

@D3SOX

Description

@D3SOX

Version: 2.9.5.1

I just ran in to this issue where it would not refresh anymore

repositories: error: failed to initialize alpm library:
(root: /, dbpath: /tmp/checkup-db-)
could not find or read directory
aur: error: failed to initialize alpm library:
(root: /, dbpath: /tmp/checkup-db-)
could not find or read directory

I diagnosed it with AI and this is what fixed it

#!/usr/bin/env bash
PLASMOID="$HOME/.local/share/plasma/plasmoids/com.github.exequtic.apdatifier"

sed -i \
  's/checkup-db-${UID}/checkup-db-$(id -u)/' \
  "$PLASMOID/contents/tools/sh/utils"

sed -i \
  's/checkup-db-${UID}/checkup-db-$(id -u)/' \
  "$PLASMOID/contents/tools/tools.js"

systemctl --user restart plasma-plasmashell

Looking at the code I don't know why $UID is not set for me here

Probably irrelevant but checkupdates works just fine

❯  checkupdates
fastfetch 2.55.1-1 -> 2.56.0-1
inkscape 1.4.2-11 -> 1.4.2-12
kodi-addon-inputstream-adaptive 21.5.17-1 -> 21.5.18-1
linux-zen 6.17.8.zen1-1 -> 6.17.9.zen1-1
linux-zen-headers 6.17.8.zen1-1 -> 6.17.9.zen1-1
poppler 25.11.0-1 -> 25.12.0-1
poppler-glib 25.11.0-1 -> 25.12.0-1
poppler-qt6 25.11.0-1 -> 25.12.0-1
python-fastapi 0.123.5-1 -> 0.124.0-1
python-httptools 0.6.4-2 -> 0.7.1-1
python-merge3 0.0.15-2 -> 0.0.16-1
python-patiencediff 0.2.15-2 -> 0.2.18-1
python-sentry_sdk 2.46.0-1 -> 2.47.0-1
❯  ls -l /tmp/checkup-db-*
Permissions Size User Group Date Modified Name
lrwxrwxrwx     - nico nico   7 Dec 15:19   local -> /var/lib/pacman/local
drwxr-xr-x     - nico nico   7 Dec 16:33   sync
❯  sudo pacman -Sy --dbpath /tmp/checkup-db-1000
[sudo] password for nico: 
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
❯  fakeroot pacman -Sy --dbpath /tmp/checkup-db-1000/ --logfile /tmp/checkup-db-1000/log
:: Synchronizing package databases...
 core is up to date
 extra                                                              8.0 MiB  21.7 MiB/s 00:00 [-------------------------------------------------------] 100%
 multilib is up to date
error: restricting filesystem access failed because the landlock ruleset could not be applied!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions