Interrupting an RPM or yum operation in mid-stream can cause interesting
problems. as can disk problems or overflowing the partition that has
/var/lib/rpm on it in mid-deployment.
Make sure no one is doing yum or rpm operations, and consider these steps:
rpm --rebuilddb # to rebuild the messed up database
That will build a clean new database in /var/lib/rpm.[numbers], and swap it
in place of the one in /var/lib/rpm when completed. Then you can try your
transactions again.
rm -f /var/lib/rpm/__* # to clear the lock files and never recorded
partial transactions
rpm --rbuilddb # try again to rebuild the messed up database
rpm -Va # To verify installed packages
There's a certain amount of risk in this, because transactions that failed
may be only partially completed. If this got wedged in the midst of
installing a kernel or glibc, for example, you may have *real* adventures
waiting for you. So it's worth running some checks to see what packages
changed recently and re-installing them, especially sensitive ones like
kernels that do some "%post" installation steps to operate correctly.
On Thu, May 10, 2012 at 2:31 AM, Frank Lanitz <[email protected]>wrote:
> Hi folks,
>
> Did anyone of you see something like this before:
>
> > ]# yum update
> > Loaded plugins: kernel-module
> > rpmdb: unable to join the environment
> > error: db4 error(11) from dbenv->open: Resource temporarily unavailable
> > error: cannot open Packages index using db3 - Resource temporarily
> unavailable (11)
> > error: cannot open Packages database in /var/lib/rpm
> > 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 already found out, that it seems that the pm-database is broken by
> $reason. Unfortunately I cannot say, what the reasons are nor when it
> did happen. However, also access rpm directly is ending up in an error
> like this (besides the Python backtrace).
>
> cheers,
> Frank
>
>
>