rpm install failed if specified --dbpath
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? |
"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" --dbpath should point to a valid rpm data base. So first you should create a rpm data base. I am not sure, but I think that the command to do that would be: rpm --initdb /home/mydir/tmp I suggest that you do not try the --initdb option as root so that you do not accidently destroy your real rpm data base. See: man rpm -------------------------- Steve Stites |
I found the answer by myself
I'd like to share with people.
--initdb cannot help. The tricks are: 1) dbpath should use a directory under local disk 2) The directory has to be created before run rpm. Empty directory is OK. 3) "provides" of spec file cannot work, and have to use --nodeps |
All times are GMT -5. The time now is 09:14 PM. |