LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-30-2002, 10:39 PM   #1
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Rep: Reputation: 31
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.
 
Old 12-30-2002, 10:43 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
make sure you are root first

Code:
root@slacker:~# whoami
root
 
Old 12-30-2002, 10:46 PM   #3
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
I am root.
 
Old 12-30-2002, 10:59 PM   #4
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
check if the directory /var/lib/rpm exists, if not, create it
 
Old 12-30-2002, 11:11 PM   #5
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
/var/lib/rpm exists.
 
Old 12-31-2002, 06:41 AM   #6
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
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).
 
Old 12-31-2002, 08:33 AM   #7
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
I's stick with rebuilding the rpm database, since rpm doesn't work for now, apt-get install won't work either.
 
Old 12-31-2002, 11:43 AM   #8
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
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?
 
Old 12-31-2002, 12:39 PM   #9
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 8.04
Posts: 668

Rep: Reputation: 31
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 !!
 
Old 12-31-2002, 04:14 PM   #10
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
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?
 
Old 01-01-2003, 11:48 AM   #11
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
I am running Red Hat 7.3. Maybe I should put that in my profile.
 
Old 01-02-2003, 06:22 AM   #12
irish_rover
Member
 
Registered: Sep 2002
Location: IN, USA
Distribution: Debian, Endian FW
Posts: 368

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get the rpm command and rpm build command on my Debian box? abefroman Debian 6 11-28-2005 01:38 PM
RPM command does not work anymore! davi_cabral Red Hat 3 09-20-2004 02:11 PM
rpm -q command praveenv Linux - Newbie 2 09-08-2004 05:41 AM
up2date & rpm command didn't work ........ [URGENT] Zi5 Linux - Software 6 05-25-2004 01:13 PM
rpm -Uvh does not work with header & rpm files in /var/spool/up2date jd_no7 Linux - Software 1 05-17-2004 06:24 PM


All times are GMT -5. The time now is 04:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration