On 2024-03-14 19:32, -pj wrote:
On 03-14-2024 07:58AM, Carlos E. R. wrote:
On 2024-03-14 06:01, -pj wrote:
Hi, I am using openSUSE TUmbleweed. What is the general principal and thought/s about recreating the 'index databases' on the machine with (# rpm --rebuilddb)?
Is there another command or systemd service that should be run after this?
Can this cause damage to the existing paths, files or directories already in place? Are there known negative effects of the command?
To me it seems like perhaps a command like 'zypper clean' or 'zypper ref' even though obviously different in what it does. Something of a sort of maintenance procedure of sorts?
Article -> https://en.wikipedia.org/wiki/RPM_Package_Manager#Forks
It is a last resource type of command, used in desperation, when the database is already broken. It only affects the database itself. I don't suppose it can cause damage if run when it is not needed. Damage comes from not being able to fully repair a broken database. Consequences will be rpm not knowing some packages are already installed or not detecting properly what to update; but again, not because the command itself breaks things, but because it fails to repair previous breakage, AFAIK.
If the command fails, there is a periodic backup of the database in /var/adm/backup/rpmdb
Thanks for your response and information on and about this. Before I received your message I proceeded to do the following. Passing 'rpm --rebuilddb' had a seemingly negative consequence. :[
1. I cloned the existing drive (SSD) to the backup (HDD) and then tested the backup, as far as booting into OS.
2. I then booted into the primary (SSD) OS. Then I passed "# rpm --rebuilddb" It took a couple minutes to complete.
As far as I know, "rpm --rebuilddb" only touches the files in "/var/lib/rpm" (currently /usr/lib/sysimage/rpm). The periodical backup is simply a copy of the /var/lib/rpm/Packages file, from which all the others can be reconstructed by the rebuild command. Nothing of the problem you describe relates to running the rebuild command. Maybe rpmconfigcheck having trouble. ...
------------------------------------------------------------------------- The 'rpm --rebuilddb' command never displayed out any output so I think that it did not fail?
Right.
Can you tell me more about the files in /var/adm/backup/rpmdb ? Are they compacted in directory form?
They are just dated and compressed copies of /usr/lib/sysimage/rpm/Packages
Thinkcentre-M57p:/var/adm/backup/rpmdb # ls -lah total 375M drwxr-xr-x 1 root root 262 Mar 14 10:57 . drwx------ 1 root root 42 Feb 2 10:16 .. -rw-r--r-- 1 root root 75M Mar 8 08:18 Packages.db-20240308.gz -rw-r--r-- 1 root root 75M Mar 9 00:15 Packages.db-20240309.gz -rw-r--r-- 1 root root 75M Mar 10 00:45 Packages.db-20240310.gz -rw-r--r-- 1 root root 75M Mar 11 00:09 Packages.db-20240311.gz -rw-r--r-- 1 root root 75M Mar 14 10:57 Packages.db-20240314.gz -rw-r--r-- 1 root root 36 Mar 14 10:57 rpmdb_recent_md5
It seems they are compacted being in .gz format. -
Reading here: https://tr.opensuse.org/SDB:RPM_database_corrupted
Says "please make a backup of the directory /var/lib/rpm first". So then create directory /var/lib/rpm.backup <- or something like that?
Sure. Or a tgz.
A question was asked on the forums by a more advanced user and the specifics of - how to retrieve a backup from /var/adm/backup/rpmdb was not discussed. Last thread -> https://forums.opensuse.org/t/regenerating-an-rpm-database-from-installed-pa...
Can you elaborate on how you would retrieve a backup from /var/adm/backup/rpmdb ? e.g. copy one of the (.gz) over to a then empty (and backup up) /var/lib/rpm and gunzip Packages.db-20240314.gz?
:|
I only had to do that once. I think I deleted /var/lib/rpm/*, copied over the last /var/adm/backup/rpmdb file, expanded it, then run rebuildrpm. Verified that the result was not corrupted, it was, so repeat with an earlier backup, till it worked. -- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)