Where does pamac keep its databases?

Hi all,

Pamac on my system just automatically refreshed its databases and informed me of some available updates via the tray applet. I find this feature very useful, but I normally do my actual package management with pacman via the CLI.

I’m currently having to use data with a cap, so I’m trying to minimise data usage, and didn’t want to have to download the 50MB or however much of databases again. So, I did sudo pacman -Su rather than my normal sudo pacman -Syu. However, pacman reported that there were no new updates…

So, my question is: are pacman and pamac using different databases? If so, why, and can I get them to use the same database to avoid repeated syncs? (Where does pamac even keep its databases? I haven’t been able to find them.)

Many thanks in advance,
Oliver

Never do that on a not-up-to-date system - you will get problems.

2 Likes

no
but yes for pacman/pamac and checkupdates

read pacman.conf :wink: but … for update notification, it’s checkupdates command

NO ! we can sync pacman database only if we update ! So for find update, we use a temporary db with checkupdates (pacman read local file time and download only if new version exists)

1 Like

As I understood it, if my package lists were out of date, pacman would just complain, but if they were up to date, it would upgrade packages as usual with no issues.
Anyway, I thought my package lists were up to date since pamac had just (I thought) resync’d them.
Thank you though for highlighting - I am aware of the issues with having different packages of different versions installed.

Thanks for your quick and informative reply!

So, if I’m understanding correctly:

  1. both pacman and pamac will sync to /var/lib/pacman/sync/ when doing a proper package sync (pacman -Sy or pamac update)
  2. but the automatic checks for updates are done via pamac checkupdate which syncs into a temporary location… From other answers it looks like that would be /tmp/pamac/dbs/sync/?

From the docs it seems like the idea behind the use of the temporary location is for safety… What would be the risks of just updating the actual pacman database? Is it just to prevent the possibility of the update process being interrupted and leaving corrupted databases (since presumably pamac checkupdate would be the correct one to use for some kind of automatic check)?

I am just wondering since this seems to somewhat waste data by downloading the databases but not using them.

Hmm… I’m confused about this checkupdate database.

I found this answer:

That seems to suggest

  1. pacman syncs into /var/lib/pacman/sync
  2. pamac update syncs into /tmp/pamac/dbs/sync
  3. pamac checkupdate syncs into /tmp/checkup-db-1000/sync

But neither /tmp/pamac nor /tmp/checkup-db-1000 exists on my system - yet pamac checkupdate can give me a full list of updates without downloading anything more, so the databases exist somewhere - but it’s not reading from /var/lib/pacman/sync because pacman still does not think there are updates available.

If you want to save on data, disable the periodic check for updates
and do it yourself once in a while.
Done.

I already have.
I still would like to know where pamac is storing its databases, because it’s not in any of the places people have suggested in /tmp and it’s not the same as where pacman is storing its databases.

Which package was reported to update from pamac? It can check AUR updates if you set you to, while pacman cannot.

A good point, but pamac checkupdates is reporting 478 packages with updates, including the linux kernel - I don’t even have that many AUR packages installed, and I recognise many as ones I installed via pacman. If I did do sudo pacman -Syu I am confident they would show up - I’m just wondering why they don’t already show up with sudo pacman -Su.

Thanks to everyone for their help, but I figured out what pamac was doing with

strace -e trace=access -f -o trace pamac checkupdates > /dev/null

which generates a list of accesses. You can then clearly see it checking access perms for /var/tmp/pamac/dbs/sync which does indeed contain a much newer copy of all the databases.

So basically, as far as I can tell, pamac update and pamac checkupdate just uses a set of databases in /var/tmp/pamac/dbs/sync whereas pacman uses databases in /var/lib/pacman/sync/.

Why pamac doesn’t just use the same set of databases as pacman I am unsure, since it just seems to me to be a waste of bandwidth. If anyone would like to comment on this, I’d be interested, but to me it seems the question has now been answered.

PS: If anyone was wondering, the databases don’t show up in locate’s output because /var/tmp is blacklisted.

no :sob:
was in my post : checkupdate make a copy of local db and … download new files only if exists new version

note : exists also a checkupdate command with pacman and not use the same directory than pamac checkupdate but, pacman and pamac use the same db for update

Pamac uses a different directory to sync databases in order to check for updates because syncing them in the default directory and not applying available updates can lead to partial upgrades.

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