Failed to initialize alpm library

I encountered this error when trying to do pamac update from my user:

cp: target '/var/tmp/pamac/dbs/sync': Permission denied
ln: failed to access '/var/tmp/pamac/dbs/local': Permission denied
Failed to initialize alpm library (could not open database)

** (pamac:19406): WARNING **: 11:30:42.296: alpm_utils.vala:294: Failed to initialize alpm library
Error: Alpm Error: Failed to initialize alpm library
Number of versions of each package to keep in the cache: 2

To delete: 0 files
Preparing...
cp: target '/var/tmp/pamac/dbs/sync': Permission denied
ln: failed to access '/var/tmp/pamac/dbs/local': Permission denied
Failed to initialize alpm library (could not open database)

** (pamac:19455): WARNING **: 11:30:43.211: alpm_utils.vala:294: Failed to initialize alpm library
Error: Alpm Error: Failed to initialize alpm library

Two points of interest:
(1) if I switch to root, pamac update works, and it also works using sudo pamac update; and
(2) sudo pacman --Syu works fine.

Below are the permissions for /var/tmp/pamac:

ls -la /var/tmp/pamac/                                                            ✔  6s  
total 24
drwxrwxrwx  5 root  root  4096 Sep  3 11:29 ./
drwxrwxrwt 13 root  root  4096 Sep  3 11:35 ../
drwxr-xr-x  4 root  root  4096 Sep  3 11:29 aur-root/
drwxr-xr-x 27 roark roark 4096 Sep  3 11:12 aur-rsync/
drw-r--r--  3 roark roark 4096 Sep  3 11:36 dbs/
-rw-r--r--  1 root  root  4096 Sep  3 11:29 pamac_aur.db

I was able to “fix” this, but by cheating. I have a laptop running Manjaro too. So I copied /var/tmp/pamac and /var/tmp/pamac/roark from the laptop to the desktop (after backing up the files in desktop).

But in case anyone else encounters this problem, I will leave this open for actual, repeatable solutions.

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