pauloray

Well-Known Member
Jan 16, 2012
76
0
56
Philippines
cPanel Access Level
Root Administrator
Hi,

I got an email saying
"An automatic check on (hostname) found the RPM database to be corrupted. An attempt was made to automatically fix the database but it was not successful. Please resolve this problem on your system. A backup of the original state of the RPM database directory can be found at /var/lib/rpm.rebuild.backup*"

I want to try this commands:
Code:
mkdir /root/old_rpm_dbs/
mv /var/lib/rpm/__db* /root/old_rpm_dbs/
rpm --rebuilddb
But when running the second line, it gives an error below and I cannot continue:
Code:
mv: cannot stat `/var/lib/rpm/__db*': No such file or directory

How can I fix this?
 

pauloray

Well-Known Member
Jan 16, 2012
76
0
56
Philippines
cPanel Access Level
Root Administrator
Hi, on mine, it has no files that starts with __db under /var/lib/rpm.

So, that has caused that error.

How can I rebuild RPM?


Also, under WHM>Software>Install a RPM> this is empty now.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello :)

If those files do not exist, proceed to the next command to rebuild the RPM database:

Code:
# rpm --rebuilddb
Thank you.
 

pauloray

Well-Known Member
Jan 16, 2012
76
0
56
Philippines
cPanel Access Level
Root Administrator
Hi, nothing happens after running the code

# rpm --rebuilddb

When I use WHM to Rebuild RPM, it will just say Complete are just 1 second. but the RPM list under Install a RPM is empty.

I do not know what happened. That was not empty before.

Please help.
 

pauloray

Well-Known Member
Jan 16, 2012
76
0
56
Philippines
cPanel Access Level
Root Administrator
I also tried to run this - # /scripts/rpmup, and it give me this error:

Loaded plugins: fastestmirror
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 309, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 157, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
self.conf
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
conf = property(fget=lambda self: self._getConfig(),
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 240, in _getConfig
self._conf = config.readMainConfig(startupconf)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 804, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 877, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

I do not know what does this means, Please help.