Page 1 of 1

RPM Database Damaged

Posted: 2005/03/24 08:01:23
by kerm1t
Hello,

I seem to have some issues with yum....


yum --install gcc
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in gcc/var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 7, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 51, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 145, in getOptionsConfig
self.conf = yumconf(configfile = conffile, root = root)
File "config.py", line 295, in __init__
File "config.py", line 365, in _getsysver
TypeError: rpmdb open failed


I checked /var/log/rpm(forgot the file name, used to rebuild) and it is missing.
I also tried rpm --initdb
and rm Packages in /var/lib/rpm

I removed __db*


No luck, any suggestions would be greatly appreciated!

-Kerm1t

RPM Database Damaged

Posted: 2005/03/24 15:27:36
by devil
check your /var/lib/rpm and del the files which have names like this "__db.001" etc, and rebuild the RPM Db with "rpm --rebuilddb"

This shd solve this .... :-)

Re: RPM Database Damaged

Posted: 2005/03/24 15:52:25
by kerm1t
Any other suggestions, do I need to reinstall? There has to be a fix...



[root@kercent log]# cd /var/lib/rpm/
[root@kercent rpm]# ls
Basenames __db.003 Installtid Provideversion Sha1header
Conflictname Dirnames Name Pubkeys Sigmd5
__db.001 Filemd5s Packages Requirename Triggername
__db.002 Group Providename Requireversion
[root@kercent rpm]# rm __db.00*
rm: remove regular file `__db.001'? y
rm: remove regular file `__db.002'? y
rm: remove regular file `__db.003'? y
[root@kercent rpm]# rpm --rebuilddb
[root@kercent rpm]# yum --install gcc
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in gcc/var/lib/rpm
Traceback (most recent call last):
File "/usr/bin/yum", line 7, in ?
yummain.main(sys.argv[1:])
File "/usr/share/yum-cli/yummain.py", line 51, in main
base.getOptionsConfig(args)
File "/usr/share/yum-cli/cli.py", line 145, in getOptionsConfig
self.conf = yumconf(configfile = conffile, root = root)
File "config.py", line 295, in __init__
File "config.py", line 365, in _getsysver
TypeError: rpmdb open failed
[root@kercent rpm]#

Re: RPM Database Damaged

Posted: 2005/03/28 14:17:53
by devil
it shd be installed as
$ yum install gcc
why -- comes in picture

try login with a diff user and try updating ...

Re: RPM Database Damaged

Posted: 2005/03/28 22:17:56
by gledesma
Try deleting the __db* files again, then run [b]rpm --rebuilddb[/b].