RPM error: can’t create transaction lock on /var/lib/rpm/__db.000

701D363E C487 419D A6DA 2D68445186AB - DevOpsBuzzSometimes when you are using rpm, it might throws the warning followed by error, like below:

[root@scmquest ]# rpm -ivh virt-what-1.11-2.el5.x86_64.rpm
warning: virt-what-1.11-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
warning: waiting for transaction lock on /var/lib/rpm/__db.000
error: can't create transaction lock on /var/lib/rpm/__db.000

You can try killing the rpm processes

[root@scmquest ]# netstat -plan | grep rpm
[root@scmquest ]# ps -ef | grep rpm
root     17018     1  0 16:11 ?        00:00:00 sudo su -c rpm -i /var/virt-what-1.11-2.el5.x86_64.rpm
root     17035 17018  0 16:11 ?        00:00:00 su -c rpm -i /var/virt-what-1.11-2.el5.x86_64.rpm
root     17036 17035  0 16:11 ?        00:00:00 rpm -i /var/virt-what-1.11-2.el5.x86_64.rpm
root     17052 17051  0 16:11 ?        00:00:00 sudo su -c rpm -i /var/ruby-libs-1.8.7.374-2.el5.x86_64.rpm
root     17069 17052  0 16:11 ?        00:00:00 su -c rpm -i /var/ruby-libs-1.8.7.374-2.el5.x86_64.rpm
root     17070 17069  0 16:11 ?        00:00:00 rpm -i /var/ruby-libs-1.8.7.374-2.el5.x86_64.rpm
root     19779 18416  0 17:32 pts/1    00:00:00 grep rpm
[root@scmquest ]# kill -9 17018 17035 17036 17052 17069 17070
[root@scmquest ]#
[root@scmquest ]# rpm -ivh virt-what-1.11-2.el5.x86_64.rpm
warning: virt-what-1.11-2.el5.x86_64.rpm: Header V3 RSA/SHA1 signature: NOKEY, key ID 4bd6ec30

If after killing the rpm processes –  your rpm hangs and not responding then its related to mount point

To proceed, first Stop the nfs daemon and  comment out the NFS mount entry in /etc/fstab

Now unmount the NFS directory

[root@scmquest ]# umount -f /mnt/shared
You have new mail in /var/spool/mail/root

You might get the error “Device or resource busy“, just wait for minutes and you will get the success

You can check with “mount” command which will confirm there is no NFS mount entry exists.

Then try with with “df -h” which will  will display the filesystem usage. If something is still wrong with mount command then, this command will also hang and will not respond. If not, all good now.

[root@scmquest ]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/rootvol	      4.9G  3.1G  1.6G  67% /
/dev/homevol          992M   34M  908M   4% /home
/dev/tmpvol           3.9G  137M  3.6G   4% /tmp
/dev/var	      3.9G  205M  3.5G   6% /var
/dev/opt	      2.0G   79M  1.8G   5% /opt
/dev/sda1             190M   18M  163M  10% /boot
tmpfs                 7.5G     0  7.5G   0% /dev/shm
/dev/local	       50G  180M   47G   1% /local

You can now try to run the rpm command and it will run properly

[root@scmquest ]# rpm -ivh virt-what-1.11-2.el5.x86_64.rpm
warning: virt-what-1.11-2.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
        package virt-what-1.11-2.el5.x86_64 is installed

Thats all, you have successfully resolved the rpm and mount error.

2 thoughts on “RPM error: can’t create transaction lock on /var/lib/rpm/__db.000”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top