Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to install a python rpm on AIX 6.1 and it was taking too long and so I had to close ther terminal.

Later when I tried to install the same rpm as root I am getting the problem as :

root:stud -> $ rpm -i -v python-2.6.7-1.aix5.1.ppc.rpm
cannot get exclusive lock on database
error: cannot open /opt/freeware/packages/packages.rpm

How can I correct this.

And on executing ps aux | egrep -i 'yum|rpm' I get:

root:stud-> $  ps aux | egrep -i 'yum|rpm'
root     2359514  0.0  0.0  240  252  pts/1 A    09:32:10  0:00 egrep -i yum|rp
share|improve this question
Is lsof /opt/freeware/packages/packages.rpm show something? – dchirikov Jan 13 '13 at 14:18
Are you running this as root? The $ sign indicates a normal user. – Khaled Jan 13 '13 at 14:20
@dchirikov : I get lsof: WARNING: compiled for AIX version; this is – gautam vegeta Jan 13 '13 at 14:21
@Khaled: Yes I'm running this as root.When I try id command I get uid=0(root) – gautam vegeta Jan 13 '13 at 14:22
Is this the only message you got? – Khaled Jan 13 '13 at 14:25

It simple means that there is some other process which is having the lock for rpm and not giving you the access. Check for any processes which might use rpm in your machine.

This command should probably help:

# ps aux | egrep -i 'yum|rpm'

If this command shows you some process (which it should), you should either wait for that process to exit and kill the process if it's not needed.

If it doesn't, try your command again, and it should work.

You can also check for the lock file also in the location /var/lib/rpm.

Simply go to that directory and check for the lock file. If it's there, which most probably is stale, as you killed the terminal earlier, simply remove the lock file.

If that also doesn't work, try rebuilding the RPM DB with this:

 # rpm  --rebuilddb
share|improve this answer
when I tried the command I got this result : root 2359514 0.0 0.0 240 252 pts/1 A 09:32:10 0:00 egrep -i yum|rp So should I be killing this process.How can I confirm this is rpm process. – gautam vegeta Jan 13 '13 at 14:33
I can't make anything out of this output here. Can you please edit the post and put it there or may be use something like pastebin and let me know – GeekRide Jan 13 '13 at 14:44
Also, to the person who voted -ve on my answer, I would really appreciate a feedback that why you did that ... and if you can't give the feedback, please don't vote – GeekRide Jan 13 '13 at 14:44
I have updated the question and posted the result. – gautam vegeta Jan 13 '13 at 14:48
Hmmm .. doesn't look that there is any other process running on the machine which is using the lock. Let me see if I can think of something else – GeekRide Jan 13 '13 at 14:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.