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?