A few findings from my end
By default, in all my installs i noticed that with AUR enabled i have:
/var/lib/pacman/sync/pamac_aur.db
owned by me
/var/tmp/pamac/dbs/sync/pamac_aur.db
owned by me
/var/tmp/pamac/pamac_aur.db
owned by me
Moreover, the following can be seen on my end:
ls -lg /var/lib/pacman/sync/
total 57424
-rw-r--r-- 1 root 7744398 2022-10-17 00:11 community.db
-rw-r--r-- 1 root 35279485 2022-10-17 00:11 community.files
-rw-r--r-- 1 root 168489 2022-10-17 00:11 core.db
-rw-r--r-- 1 root 1465297 2022-10-17 00:11 core.files
-rw-r--r-- 1 root 1885841 2022-10-17 00:11 extra.db
-rw-r--r-- 1 root 10011471 2022-10-17 00:11 extra.files
-rw-r--r-- 1 root 35112 2022-10-17 00:13 herecura.db
-rw-r--r-- 1 root 728968 2022-10-17 00:13 herecura.files
-rw-r--r-- 1 root 234323 2021-02-25 03:59 kde-unstable.db
-rw-r--r-- 1 root 751565 2021-02-25 03:59 kde-unstable.files
-rw-r--r-- 1 root 15249 2020-06-14 16:39 mhwd.db
-rw-r--r-- 1 root 178589 2022-10-15 17:08 multilib.db
-rw-r--r-- 1 root 263066 2022-10-15 17:08 multilib.files
-rw-r--r-- 1 bogdan 2560 2022-10-17 08:16 pamac_aur.db
-rw-r--r-- 1 root 0 2022-10-17 07:55 refresh_timestamp
ls -lg /var/tmp/pamac/dbs/sync/
total 57432
-rw-r--r-- 1 bogdan 7744398 2022-10-17 00:11 community.db
-rw-r--r-- 1 bogdan 35279485 2022-10-17 00:11 community.files
-rw-r--r-- 1 bogdan 168489 2022-10-17 00:11 core.db
-rw-r--r-- 1 bogdan 1465297 2022-10-17 00:11 core.files
-rw-r--r-- 1 bogdan 1885841 2022-10-17 00:11 extra.db
-rw-r--r-- 1 bogdan 10011471 2022-10-17 00:11 extra.files
-rw-r--r-- 1 bogdan 35112 2022-10-17 00:13 herecura.db
-rw-r--r-- 1 bogdan 728968 2022-10-17 00:13 herecura.files
-rw-r--r-- 1 bogdan 234323 2021-02-25 03:59 kde-unstable.db
-rw-r--r-- 1 bogdan 751565 2021-02-25 03:59 kde-unstable.files
-rw-r--r-- 1 bogdan 15249 2020-06-14 16:39 mhwd.db
-rw-r--r-- 1 bogdan 178589 2022-10-15 17:08 multilib.db
-rw-r--r-- 1 bogdan 263066 2022-10-15 17:08 multilib.files
-rw-r--r-- 1 bogdan 2560 2022-10-17 08:16 pamac_aur.db
-rw-rw-rw- 1 root 0 2022-10-17 08:17 refresh_timestamp
Aside the fact that i actually don't use the kde-unstable
anymore on this particular install for a couple months now, i guess that i can asume is a fluke that i will investigate on my end before call it a minor bug in pamac/pacman.
After this commit: 1eeff6a7 i have:
/var/lib/pacman/sync/pamac_aur.db
owned by me
/var/tmp/pamac/dbs/sync/pamac_aur.db
owned by root
/var/tmp/pamac/pamac_aur.db
owned by me
So, regardless if i run just pamac
or sudo pamac
now i have:
ls -lg /var/tmp/pamac/dbs/sync/
total 57432
-rw-r--r-- 1 root 7744398 2022-10-17 00:11 community.db
-rw-r--r-- 1 root 35279485 2022-10-17 00:11 community.files
-rw-r--r-- 1 root 168489 2022-10-17 00:11 core.db
-rw-r--r-- 1 root 1465297 2022-10-17 00:11 core.files
-rw-r--r-- 1 root 1885841 2022-10-17 00:11 extra.db
-rw-r--r-- 1 root 10011471 2022-10-17 00:11 extra.files
-rw-r--r-- 1 root 35112 2022-10-17 00:13 herecura.db
-rw-r--r-- 1 root 728968 2022-10-17 00:13 herecura.files
-rw-rw-rw- 1 root 234323 2021-02-25 03:59 kde-unstable.db
-rw-rw-rw- 1 root 751565 2021-02-25 03:59 kde-unstable.files
-rw-rw-rw- 1 root 15249 2020-06-14 16:39 mhwd.db
-rw-r--r-- 1 root 178589 2022-10-15 17:08 multilib.db
-rw-r--r-- 1 root 263066 2022-10-15 17:08 multilib.files
-rw-rw-rw- 1 root 2560 2022-10-17 08:16 pamac_aur.db
-rw-rw-rw- 1 root 0 2022-10-17 09:17 refresh_timestamp
Removing the /tmp
will make Pamac UI and CLI fail to download/create the pamac_aur.db
pamac update
Preparing...
Synchronizing package databases...
** (pamac:10105): WARNING **: 09:12:55.205: aur.vala:118: Error creating directory /var/tmp/pamac-build-bogdan: Permission denied
Failed to synchronize AUR database
Nothing to do.
Transaction successfully finished.
Pamac UI Preferences > Third Party > AUR, by default, will point to build the packages in /tmp but there is nothing about the pamac_aur.db
where to save it when syncing database, nor has options for repositories db, so i guess are predefined to be saved in /var/tmp/pamac/dbs/sync/
and/or /var/tmp/pamac/
just the pamac_aur.db and /var/lib/pacman/sync/
My initial understanding, based on the ownership/permissions of the .db files, i thought those need to be separated in that folder structure, and is not a redundancy of db files, but to be honest, now i'm confused, especially for the triple existence of the pamac_aur.db
, and the use or no use of sudo
with pamac
even tho, in my vision, i would see it this way:
/var/lib/pacman/sync/
contain the repositories .db files (no AUR) owned by root (so pamac can be run with sudo or polkit, CLI or UI) > that are symlinked to /var/tmp/pamac/dbs/sync/
and /var/tmp/pamac/pamac_aur.db
for AUR owned by user but then how will pamac update -a
set the permissions on that file if not to root, so then all db files could be in one place, owned by root and users use or not sudo with pamac?