You are not logged in.

#1 2023-07-27 22:50:34

NuSkool
Member
Registered: 2015-03-23
Posts: 266

Pacman databases: '~/aur.db.tar.gz' and /var/lib/pacman/sync/aur.db

I've created a user AUR pacman repo. This has worked out well over the years.

Today, I managed to screw up /var/lib/pacman/sync/aur.db, in removing everything in it during running a set up script for a second user, and having "groff" entered in the "IgnorePkg" section of pacman.conf.

My script used pacstrap, and it failed on groff, and my script continued on....  Then I proceeded with running a bunch of commands manually that ultimately resulted in the removal of all the contents of /var/lib/pacman/sync/aur.db.

Long story short, I still had my user created  ~/repo/aur.db.tar.gz that was populated, and repopulated /var/lib/pacman/sync/aur.db from it and everything's back to normal. This is not the first time and will likely not be the last.

However, I'm confused to the relationship between   ~/repo/aur.db.tar.gz   and   /var/lib/pacman/sync/aur.db   and how things work.

In prep for restoring /var/lib/pacman/sync/aur.db, I had ran 'pacman -Sl aur ', which showed nothing. Running 'pacman -Qm' showed all my AUR packages. This is just the opposite of normal on my system. Further checking indicated that /var/lib/pacman/sync/aur.db was empty, but ~/repo/aur.db.tar.gz was still populated.

My thoughts were I could manually reenter the packages into /var/lib/pacman/sync/aur.db using 'repo-add', but that's a no go, with an error about proper db extension.

My next move was to rebuild an existing AUR package using my home grown AUR helper. In building/rebuilding an AUR package, the script enters the package data into ~/repo/aur.db.tar.gz.

Next I reran 'pacman -Sl aur', and lo and behold the entire /var/lib/pacman/sync/aur.db was repopulated with all the packages from I'm guessing, the contents of ~/repo/aur.db.tar.gz.

What's going on here and is there a pacman command that would have straightened this out? I'm specifically thinking 'pacman -Syy' or 'pacsync aur'?

Last edited by NuSkool (2023-07-27 23:04:14)


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

#2 2023-07-27 23:28:59

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,521
Website

Re: Pacman databases: '~/aur.db.tar.gz' and /var/lib/pacman/sync/aur.db

pacman automatically detects the kind of compression used in repo databases, so the files in /var/lib/pacman/*.db have the ".tar.gz" or ".tar.zst", etc stripped.  repo-add requires being told what compression you want to use.

Offline

#3 2023-07-28 00:44:14

NuSkool
Member
Registered: 2015-03-23
Posts: 266

Re: Pacman databases: '~/aur.db.tar.gz' and /var/lib/pacman/sync/aur.db

Thanks Allan!,

So based on:

$ file /var/lib/pacman/sync/aur.db
/var/lib/pacman/sync/aur.db: gzip compressed data, from Unix, original size modulo 2^32 102400

$ file ~/repo/aur.db.tar.gz
~/repo/aur.db.tar.gz: gzip compressed data, from Unix, original size modulo 2^32 102400

Would appending '.tar.gz' to '/var/lib/pacman/sync/aur.db' do the trick with using repo-add?



Since '/var/lib/pacman/sync/aur.db' is not a link to '~/repo/aur.db.tar.gz', when is it updated by pacman to changes made in the former?

It seems that when my script re/entering a single packages data into '~/repo/aur.db.tar.gz', pacman updated all the existing date from the former, to the later.

Does this sound plausable?

Why are there two db's for user created db's? Am I missing something related to sync vs local?

Where pacman created db's are, one is compressed into an archive, and the other is not.

Are both the equivalent user created db's a compressed archive?


Scripts I Use                                                 :  https://github.com/Cody-Learner
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 7 8745HS w/ Radeon 780M Graphics
grep -m1 'model name' /proc/cpuinfo    : Intel(R) N95
grep -m1 'model name' /proc/cpuinfo    : AMD Ryzen 5 PRO 2400GE w/ Radeon Vega Graphics

Offline

#4 2023-07-28 02:41:48

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,521
Website

Re: Pacman databases: '~/aur.db.tar.gz' and /var/lib/pacman/sync/aur.db

Adding .tar.gz will make repo-add work.

You will note that when you run repo-add, a symlink is made to the .db version in the same directory.  I'm assuming your pacman configuration "downloads" this file to store in /var/lib/pacman/sync.

Offline

Board footer

Powered by FluxBB