LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rpm command won't work (https://www.linuxquestions.org/questions/linux-newbie-8/rpm-command-wont-work-39825/)

Travis86 12-30-2002 09:39 PM

rpm command won't work
 
I am trying to install Samba, which comes in three rpm's. I type "rpm -ivh samba-clinet-2.2.3a-6.i386" and it says:

error: cannot get exclusive lock on /var/lib/rpm/Packages
error: cannot open Packages index using db3 - Operation not permitted(1)
error: cannot open Packages database in /var/lib/rpm

I am just learning Linux and have never used the rpm command before. Why won't rpm work?

Thanks.

DavidPhillips 12-30-2002 09:43 PM

make sure you are root first

Code:

root@slacker:~# whoami
root


Travis86 12-30-2002 09:46 PM

I am root.

iceman47 12-30-2002 09:59 PM

check if the directory /var/lib/rpm exists, if not, create it

Travis86 12-30-2002 10:11 PM

/var/lib/rpm exists.

irish_rover 12-31-2002 05:41 AM

Make sure no other processes are using rpm (gnorpm is not open....). Since you are using RedHat I would start using apt to do get and install your rpm's. http://freshmeat.net. If no other processes are locking the rpm database you might need to rebuild it. rpmdb --rebuild (this will take a while depending on what you have installed/speed of machine..so on).

iceman47 12-31-2002 07:33 AM

I's stick with rebuilding the rpm database, since rpm doesn't work for now, apt-get install won't work either.

Travis86 12-31-2002 10:43 AM

When I was shutting it down last night, I decided to try it one more time and it worked! The only thing that could have been the matter was that I was trying it in an xterm the first time, and I did it at the terminal the second. Could this be the problem? If so, why?

jglen490 12-31-2002 11:39 AM

Quote:

error: cannot get exclusive lock on /var/lib/rpm/Packages
error: cannot open Packages index using db3 - Operation not permitted(1)
error: cannot open Packages database in /var/lib/rpm
The only time I've ever gotten these errors is when I tried to run rpm as my "normal" user. After doing:

su -

It always works :D !!

irish_rover 12-31-2002 03:14 PM

I thought more about this, what version of RedHat are you running. Maybe there is an automatic update program that is lock the rpm database?

Travis86 01-01-2003 10:48 AM

I am running Red Hat 7.3. Maybe I should put that in my profile.

irish_rover 01-02-2003 05:22 AM

Check what processes are running next time you get that error. Maybe you could see if any instance of rpm is running list everything with 'ps aux' or if you want to narrow it down do 'ps aux -C rpm | grep rpm' to only show processes with the name rpm. I would also look for up2date to see if it is hanging on somewhere? Either way if you are root then the only thing that should be causing this is some other process locking the rpm database.


All times are GMT -5. The time now is 11:39 PM.