1

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
8
  • Is lsof /opt/freeware/packages/packages.rpm show something?
    – dchirikov
    Jan 13, 2013 at 14:18
  • 2
    Are you running this as root? The $ sign indicates a normal user.
    – Khaled
    Jan 13, 2013 at 14:20
  • @dchirikov : I get lsof: WARNING: compiled for AIX version 5.1.0.0; this is 6.1.0.0. Jan 13, 2013 at 14:21
  • @Khaled: Yes I'm running this as root.When I try id command I get uid=0(root) Jan 13, 2013 at 14:22
  • 1
    OK. you have installed wrong version of lsof. Does fuser /opt/freeware/packages/packages.rpm work?
    – dchirikov
    Jan 13, 2013 at 16:06

1 Answer 1

2

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
10
  • 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. Jan 13, 2013 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
    – Napster_X
    Jan 13, 2013 at 14:44
  • 1
    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
    – Napster_X
    Jan 13, 2013 at 14:44
  • I have updated the question and posted the result. Jan 13, 2013 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
    – Napster_X
    Jan 13, 2013 at 14:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .