RPM Community Forums

Mailing List Message of <rpm-users>

Error in changing Default Location of RPM database

From: Manoj Palhade <mpalhade@googlemail.com>
Date: Tue 09 Feb 2010 - 15:51:05 CET
Message-ID: <67f63fb1002090651m79e82c57i90efa4db7d3cd27b@mail.gmail.com>
Dear RPM Team,

 As discussed previously regarding “Default Location of RPM database”

Default Location of RPM database is stored in %_dbpath variable in
*macro* file at /lib/rpm folder



Value of *%_dbpath* variable is %{_var}/lib/rpm



I done following changed in *macro* file at /lib/rpm folder

So instead of changing “%_dbpath”; I made changes in “_var” variable.



I changed value of %_var variable.

%_var /var/sys/opt instead of /opt/sys/var



I am using following options in "configure" command

--with-dbabi=sqlite

--with-sqlite=/opt/sys

--without-db


*After this I tried to execute RPM commands such as #rpm –e. But I am
getting following error.*

# rpm -Uvh Opt-1.0-1.x86pc.rpm

*error: cannot open Packages database in /var/opt/sys/lib/rpm*

*error: cannot open Packages database in /var/opt/sys/lib/rpm*

* *

# rpm -qa
*error: cannot open Packages database in /var/opt/sys/lib/rpm* *After this I
tired following command *

#cd /var/opt/sys/lib/rpm



# file *

Basenames:      Berkeley DB (Btree, version 9, native byte-order)

Conflictname:   Berkeley DB (Btree, version 9, native byte-order)

Dirnames:       Berkeley DB (Btree, version 9, native byte-order)

Filedigests:    Berkeley DB (Hash, version 9, native byte-order)

Filepaths:      Berkeley DB (Btree, version 9, native byte-order)

Group:          Berkeley DB (Btree, version 9, native byte-order)

Installtid:     Berkeley DB (Btree, version 9, native byte-order)

Name:           Berkeley DB (Btree, version 9, native byte-order)

Nvra:           Berkeley DB (Btree, version 9, native byte-order)

Packagecolor:   Berkeley DB (Hash, version 9, native byte-order)

Packages:       Berkeley DB (Btree, version 9, native byte-order)

Providename:    Berkeley DB (Btree, version 9, native byte-order)

Provideversion: Berkeley DB (Btree, version 9, native byte-order)

Requirename:    Berkeley DB (Btree, version 9, native byte-order)

Sha1header:     Berkeley DB (Hash, version 9, native byte-order)

Sigmd5:         Berkeley DB (Hash, version 9, native byte-order)

Sourcepkgid:    Berkeley DB (Btree, version 9, native byte-order)

Triggername:    Berkeley DB (Btree, version 9, native byte-order)

#
*I am not sure How is above “*Berkeley DB” files are getting created. Same
error I am getting is I change “_dbpath” variable instead of “_var” variable
Please let me know how to resolve this Berkeley DB Issue.

*I rollback (reversed) changes in macro file at /lib/rpm folder.* Now
value of %_var variable /opt/sys/var

I tried following command which is giving expected output and I am
able to execute RPM commands like install RPM package.


# cd /opt/sys/var/lib/rpm

# file *

Packages: SQLite 3.x database

# sqlite3 Packages

SQLite version 3.6.14.2

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite> .dump

BEGIN TRANSACTION;

CREATE TABLE 'Packages' (key int UNIQUE PRIMARY KEY, value blob);

CREATE TABLE 'db_info' (endian TEXT);

INSERT INTO "db_info" VALUES('68');

COMMIT;

sqlite> .exit

#



# rpm -Uvh /opt/sys/src/rpm/RPMS/x86pc/Opt-hmi-1.0-1.x86pc.rpm

Preparing...                ###########################################
[100%]

   1:Opt-hmi                ###########################################
[100%]

#



# file *

Basenames:      SQLite 3.x database

Conflictname:   SQLite 3.x database

Dirnames:       SQLite 3.x database

Filedigests:    SQLite 3.x database

Filepaths:      SQLite 3.x database

Group:          SQLite 3.x database

Installtid:     SQLite 3.x database

Name:           SQLite 3.x database

Nvra:           SQLite 3.x database

Packagecolor:   SQLite 3.x database

Packages:       SQLite 3.x database

Providename:    SQLite 3.x database

Provideversion: SQLite 3.x database

Sha1header:     SQLite 3.x database

Sigmd5:         SQLite 3.x database

Sourcepkgid:    SQLite 3.x database

Triggername:    SQLite 3.x database

#


Please let me know How to change “Default Location of RPM database” with out
getting created “Berkeley DB” files.



Thanks and Regards,
Manoj Palhade
Received on Tue Feb 9 15:51:22 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.