NotebookForums.com › Forums › General Notebook Discussions › Linux & Other OS's › run rpm always failed if specified --dbpath
New Posts  All Forums:Forum Nav:

run rpm always failed if specified --dbpath

post #1 of 2
Thread Starter 
I try to install something on a SuSe 8 box, the rpm version is 3.0.6.

However, if I run following command:

rpm -ivh --dbpath /home/mydir/tmp xxx.rpm

It always failed with following error msg:

cannot get exclusive lock on database
error: cannot open /home/mydir/tmp/packages.rpm

Even if I use root, it still fails if I specified --dbpath.

But if I do not specify --dbpath and run the rpm as root, it works.

/home/mydir/tmp is an empty directory I created for the this test. So it's not due to write permission.

Can any one shed a light for me?
post #2 of 2
If you take a look at the rpm(8) man page, you will see that the --dbpath option is used to specify another package database, not another package. So, if you want to do that, you should run the following command first:

rpm --rebuilddb -v --dbpath /home/mydir/tmp

This will create a database using the currently installed packages on your computer in /home/mydir/tmp. Now, you can run your command and it should work fine. Note that the installation record for xxx.rpm will only be added to the database in /home/mydir/tmp, not to the default one in /var/lib/rpm.

NOTE: if you don't want the database in /home/mydir/tmp to contain a record of all the packages you have currently installed, replace --rebuilddb with --initdb.

Regards,

zakaluka2.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux & Other OS's
NotebookForums.com › Forums › General Notebook Discussions › Linux & Other OS's › run rpm always failed if specified --dbpath