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. |
make sure you are root first
Code:
root@slacker:~# whoami |
I am root.
|
check if the directory /var/lib/rpm exists, if not, create it
|
/var/lib/rpm exists.
|
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).
|
I's stick with rebuilding the rpm database, since rpm doesn't work for now, apt-get install won't work either.
|
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?
|
Quote:
su - It always works :D !! |
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?
|
I am running Red Hat 7.3. Maybe I should put that in my profile.
|
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. |