rpmdb --initdb work for me
Blaž Bogataj
----------- Alfred von Campe wrote: "I am in the process of updating a dozen or so workstations from CentOS 4.3 to CentOS 4.4. I set up a local YUM repository, and have been able to successfully update all systems except for one. Both yum and rpm either hang or core dump on this system. I've done a "yum clean all" and an "rpm --rebuilddb" (after deleting the __db files). I was able to successfully update yum itself, but now even a "yum --version" or "rpm -q yum" hang and can only be killed with a "kill -9 <pid>".
Any suggestions on how to proceed? I had no problems on any of the other systems, and they were all configured the same way. I wonder if I may have screwed up when trying to clean up the RPM database (I was following instructions posted a few months ago to this mailing list)...
Alfred"
Blaž Bogataj wrote:
rpmdb --initdb work for me
I really cannot let this statement stand on its own there.
In the best case rpmdb --initdb does *not* do anything, because it sees that there already is an rpmdb in place. See for yourself:
| [root@reboot ~]# ls -l /var/lib/rpm/ | total 29860 | -rw-r--r-- 1 rpm rpm 4878336 Sep 27 00:58 Basenames | -rw-r--r-- 1 rpm rpm 12288 Sep 26 14:57 Conflictname | -rw-r--r-- 1 rpm rpm 1761280 Sep 27 00:58 Dirnames | -rw-r--r-- 1 rpm rpm 5152768 Sep 27 00:58 Filemd5s | -rw-r--r-- 1 rpm rpm 12288 Sep 27 00:58 Group | -rw-r--r-- 1 rpm rpm 16384 Sep 27 00:58 Installtid | -rw-r--r-- 1 rpm rpm 24576 Sep 27 00:58 Name | -rw-r--r-- 1 rpm rpm 20668416 Sep 27 00:58 Packages | -rw-r--r-- 1 rpm rpm 180224 Sep 27 00:58 Providename | -rw-r--r-- 1 rpm rpm 77824 Sep 27 00:58 Provideversion | -rw-r--r-- 1 rpm rpm 12288 Sep 25 13:27 Pubkeys | -rw-r--r-- 1 rpm rpm 196608 Sep 27 00:58 Requirename | -rw-r--r-- 1 rpm rpm 110592 Sep 27 00:58 Requireversion | -rw-r--r-- 1 rpm rpm 77824 Sep 27 00:58 Sha1header | -rw-r--r-- 1 rpm rpm 45056 Sep 27 00:58 Sigmd5 | -rw-r--r-- 1 rpm rpm 12288 Sep 27 00:58 Triggername | [root@reboot ~]# rpmdb --initdb | [root@reboot ~]# ls -l /var/lib/rpm/ | total 29904 | -rw-r--r-- 1 rpm rpm 4878336 Sep 27 00:58 Basenames | -rw-r--r-- 1 rpm rpm 12288 Sep 26 14:57 Conflictname | -rw-r--r-- 1 root root 16384 Oct 4 13:02 __db.001 | -rw-r--r-- 1 root root 1318912 Oct 4 13:02 __db.002 | -rw-r--r-- 1 root root 450560 Oct 4 13:02 __db.003 | -rw-r--r-- 1 rpm rpm 1761280 Sep 27 00:58 Dirnames | -rw-r--r-- 1 rpm rpm 5152768 Sep 27 00:58 Filemd5s | -rw-r--r-- 1 rpm rpm 12288 Sep 27 00:58 Group | -rw-r--r-- 1 rpm rpm 16384 Sep 27 00:58 Installtid | -rw-r--r-- 1 rpm rpm 24576 Sep 27 00:58 Name | -rw-r--r-- 1 rpm rpm 20668416 Oct 4 13:02 Packages | -rw-r--r-- 1 rpm rpm 180224 Sep 27 00:58 Providename | -rw-r--r-- 1 rpm rpm 77824 Sep 27 00:58 Provideversion | -rw-r--r-- 1 rpm rpm 12288 Sep 25 13:27 Pubkeys | -rw-r--r-- 1 rpm rpm 196608 Sep 27 00:58 Requirename | -rw-r--r-- 1 rpm rpm 110592 Sep 27 00:58 Requireversion | -rw-r--r-- 1 rpm rpm 77824 Sep 27 00:58 Sha1header | -rw-r--r-- 1 rpm rpm 45056 Sep 27 00:58 Sigmd5 | -rw-r--r-- 1 rpm rpm 12288 Sep 27 00:58 Triggername
In the worst case, you create an empty rpm database. Which normally means "reinstall everything". And that can be had easier.
So "rpmdb --initdb" is a command you normally *do not* want to use on a live system - or maybe only for creating an empty rpm database somewhere else on your system for chroot builds or similar.
In three words: "--initdb considered harmful".
Ralph