Mailinglist Archive: opensuse (929 mails)

< Previous Next >
Re: [opensuse] Help - rpm - error: no dbpath has been set - howto fix?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/17/2014 11:11 AM, Andrey Borzenkov wrote:
В Mon, 17 Mar 2014 11:00:15 -0500
"David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx> пишет:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/16/2014 04:34 PM, Carlos E. R. wrote:
On 2014-03-16 21:40, David C. Rankin wrote:

Ok, so apparently rpm lost a link/file that sets the dbpath so rpm
doesn't
know what is installed and can't find it's cache. How do I fix this? I
haven't
messed with the actual dbpath for rpm before -- where is it set and to
what? Any
help appreciated. Thanks.

The rpm database is in "/var/lib/rpm/". In 13.1 I have:

/var/lib/rpm/
├── Basenames
├── Conflictname
├── Dirnames
├── Group
├── Installtid
├── Name
├── Obsoletename
├── Packages
├── Providename
├── Pubkeys
├── Requirename
├── Sha1header
├── Sigmd5
├── Triggername
├── alternatives/


The crucial one is "Packages", the rest can be rebuilt. If "Packages" is
missing, there are backups in "/var/adm/backup/rpmdb/". Pick the newest
file, expand it, delete the rest, and run "rpm rebuild" (check the exact
command name in man).

If it fails, pick the following older packages file, and retry till it
works...


Thanks Carlos,

This is strange, I have all the files in /var/lib/rpm:

[10:55 alchemy:~] # l /var/lib/rpm
total 198204
drwxr-xr-x 2 root root 4096 Dec 10 18:06 alternatives
- -rw-r--r-- 1 root root 22122496 Feb 17 01:19 Basenames
- -rw-r--r-- 1 root root 12288 Dec 12 14:48 Conflictname
- -rw-r--r-- 1 root root 12300288 Feb 17 01:19 Dirnames
- -rw-r--r-- 1 root root 21651456 Feb 17 01:19 Filedigests
- -rw-r--r-- 1 root root 65536 Feb 17 01:19 Group
- -rw-r--r-- 1 root root 131072 Feb 17 01:19 Installtid
- -rw-r--r-- 1 root root 176128 Feb 17 01:19 Name
- -rw-r--r-- 1 root root 86016 Feb 15 15:21 Obsoletename
- -rw-r--r-- 1 root root 144883712 Feb 17 01:19 Packages
- -rw-r--r-- 1 root root 5177344 Feb 17 01:19 Providename
- -rw-r--r-- 1 root root 1712128 Feb 17 01:19 Provideversion
- -rw-r--r-- 1 root root 12288 Jan 1 16:07 Pubkeys
- -rw-r--r-- 1 root root 933888 Feb 17 01:19 Requirename
- -rw-r--r-- 1 root root 569344 Feb 17 01:19 Requireversion
- -rw-r--r-- 1 root root 0 Mar 9 2011 .rpm.lock
- -rw-r--r-- 1 root root 323584 Feb 17 01:19 Sha1header
- -rw-r--r-- 1 root root 163840 Feb 17 01:19 Sigmd5
- -rw-r--r-- 1 root root 12288 Dec 12 14:48 Triggername

The lock file looks odd, but given the date, that doesn't seem like a likely
candidate. I have tried both:

rpm --initdb
rpm --rebuilddb

Both give the same failure

[10:55 alchemy:~] # rpm --rebuilddb
error: can't create transaction lock on / (Is a directory)

So it really looks like the setting that tell rpm where to look is missing or
corrupt.


Try "rpm --dbpath /var/lib/rpm" - does it work? What "rpm --showrc |
grep dbpath" shows?
N▀╖╡ФЛr╦⌡yИ ┼Z)z{.╠О╝·к⌡╠йБmЙ)z{.╠Й+│:╒{Zrшaz▄'z╥╕j)h╔ИЛ╨г╬ё ч╝┼^·к╛z┼Ю


Andrey, thanks. We are getting somewhere:

[11:34 alchemy:~] # rpm --dbpath=/var/lib/rpm -qa
error: dbiOpen: dbapi 1 not available
error: cannot open Packages database in /var/lib/rpm
error: dbiOpen: dbapi 1 not available
error: cannot open Packages database in /var/lib/rpm

[11:35 alchemy:~] # rpm --showrc | grep dbpath
{shows nothing}

But:

[11:36 alchemy:~] # rpm --dbpath=/var/lib/rpm --showrc | grep dbpath
-8: _dbpath /var/lib/rpm

Going further:

[11:37 alchemy:~] # rpm -vv --dbpath=/var/lib/rpm -qa
D: loading keyring from pubkeys in /%{_keyringpath}/*.key
D: couldn't find any keys in /%{_keyringpath}/*.key
D: loading keyring from rpmdb
error: dbiOpen: dbapi 1 not available
error: cannot open Packages database in /var/lib/rpm
error: dbiOpen: dbapi 1 not available
error: cannot open Packages database in /var/lib/rpm

[11:38 alchemy:~] # rpm -vv --root=/var/lib/rpm --dbpath=/var/lib/rpm -qa
D: loading keyring from pubkeys in /var/lib/rpm/%{_keyringpath}/*.key
D: couldn't find any keys in /var/lib/rpm/%{_keyringpath}/*.key
D: loading keyring from rpmdb
D: created directory(s) /var/lib/rpm/var/lib/rpm mode 0755
D: created directory(s) /var/lib/rpm/var/lib/rpm mode 0755
D: created directory(s) /var/lib/rpm/var/lib/rpm mode 0755
error: dbiOpen: dbapi 1 not available
error: cannot open Packages database in /var/lib/rpm/var/lib/rpm
error: dbiOpen: dbapi 1 not available
error: cannot open Packages database in /var/lib/rpm/var/lib/rpm

Some setting is completely gone -- what to try next?

- --
David C. Rankin, J.D.,P.E.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlMnJXkACgkQZMpuZ8CyrcgtXACffuGm7PcGbAXyctF0UEjklwMX
0W0Ani24wfVy8nw8k9UYSpk480NmULvl
=Uklt
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups