
If rpm / yum command hangs during operations or you see error messages - it means your rpm database corrupted. /var/lib/rpm/ stores rpm database just delete the same and rebuild rpm database:
Command to rebuild rpm database
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
Read rpm / yum man pages for more information
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins

- My 10 UNIX Command Line Mistakes
- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
Facebook it - Tweet it - Print it -
We're here to help you make the most of sysadmin work. So, subscribe!

{ 5 comments… read them below or add one }
Thanks for the help.
Thanks………..This is simple and Best solution..
Thanks again, NixCraft!
Hi i am facing the same problem , i an not able to install any rpm through rpm commands or yum .
when i run rpm -ivh package name i got below error :
error: can’t create transaction lock on /var/lib/rpm/__db.000
even i am not able to remove the /var/lib/rpm then __db.00* file
i got the below error :=
[root@Rajnish rpm]# rm -rf __db.00*
rm: cannot remove `__db.001′: Permission denied
rm: cannot remove `__db.002′: Permission denied
rm: cannot remove `__db.003′: Permission denied
[root@Rajnish rpm]#
i am using centos 5.4 for Detaill :-
uname -a
Linux Rajnish 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
any suggestion . how can i get out from here .
Rajnish,
I have had this problem in the past. I *believe* it happens when a running process is accessing the files.
Also, are you running as root? That could be why you are getting the “Permission denied” error.