Every time you query rpm database against your rpm package manager, your linux terminal and query seems to hang and you cannot do something about it except try to kill and terminate the current rpm query process.
One probable cause for this could be a recent rpm query was unexpectedly terminated by hitting Control+C, that left rpm on a inaccurate state or rpm stale lock status. RPM when terminated unexpectedly cannot flush out pending query jobs from it thus, leaving rpm database with an inaccurate rpm database lock state.
Repair RPM Database Files
Take a look at rpm database usually found here from Fedora box
# cd /var/lib/rpm
# ls -la
You will see similar lines like these
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r-- 1 root root 24576 2008-01-18 17:05 __db.001
-rw-r--r-- 1 root root 1318912 2008-01-18 17:05 __db.002
-rw-r--r-- 1 root root 450560 2008-01-18 17:05 __db.003
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First step on repairing rpm database is to kill the process of the defunct and currently running rpm binary.
Proceed to repairing by killing the defunct rpm PIDs and deleting the rpm database, like so
# ps axuw | grep rpm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
root 15294 3.2 15.1 164960 /usr/bin/python /usr/bin/yum -y install whatever
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kill the pending rpm process ID
# kill -9 15294
Delete the rpm package database files
# rm -rf /var/lib/rpm/__db.00*
Now try to do another rpm query
# rpm -qa whichever
This should fix the problem and rpm should reply with your query.
If the problem still exists, you can rebuild your rpm database by simply issuing the rpm database rebuilddb parameter like so
# rpm --rebuilddb
A more verbosed rpm database rebuild would be
# rpm -vv --rebuilddb
It would take some time though that should fix it. Then after, list out again the rpm files
# ls -la /var/lib/rpm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r-- 1 root root 24576 2008-01-18 17:05 __db.001
-rw-r--r-- 1 root root 1318912 2008-01-18 17:05 __db.002
-rw-r--r-- 1 root root 450560 2008-01-18 17:05 __db.003
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If all still fails, you need to do the above commands under linux single mode, which brings out another issue of rebooting your server box. Usually, the above does the trick, I never experienced booting to single mode just to have my rpm database rebuilt.
Enjoy.
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2008
(2301)
-
▼
January
(49)
- HowTo: Brasero
- HowTo: ISOs Management for Fedora
- HowTo: Install Nmap with GUI FrontEnd
- HowTo: Create and Manage Genealogy Family Tree via...
- HowTo: Install KFTPGrabber FTP Client
- HowTo: Install FileZilla 3 on Fedora 8
- HowTo: Be Alerted via Popups When Monitoring Log F...
- HowTo: Mount Windows Drive From Linux GUI
- HowTo: Delete Files With 0K Filesize Recursively
- HowTo: Changing Interface's MTU Size
- HowTo: Create Vanishing Virtual Drive
- HowTo: Install Identity.pub Into Remote Machines
- HowTo: Check and Mark Bad Block Of Hard Disk
- HowTo: Install Linux Hardware Browser
- HowTo: Basic RPM Package Queries And Usage
- HowTo: Rebuild Locked Out RPM Database
- HowTo: Display RPM Packages Installed Last Month
- HowTo: Display and List Out All Package Files Rece...
- HowTo: Identify Source Package Name Of A File or F...
- HowTo: Delete Extra Spaces Between Words From Files
- HowTo: Find Hidden Directory Folders Recursively
- HowTo: Create Hidden Directory Folder
- HowTo: Print Only Lines of Text File with N charac...
- HowTo: Sort Files by FileSize and What Else?
- HowTo: Squeezed Out Multiple Lines From Text File
- HowTo: Prevent Binary Execution From Mounted Device
- HowTo: Determine Domain's Expiration Date From Lin...
- HowTo: Create and Overwrite Existing Alias
- HowTo: Get MAC Address of PCs Around
- HowTo: List Out Hidden Files and Hidden Directory ...
- HowTo: Identify Valid Login Shells
- HowTo: Deny User from Logging Into Your System
- HowTo: Remove Tabs From Text Files Completely
- HowTo: Convert Tabs In Each File To Spaces
- HowTo: Install and Say Cheese
- HowTo: Install HomeBank and Manage Personal & ...
- HowTo: Install Mind-Mapping LabyRinth Tool
- HowTo: Install VMWare Server on Fedora 8
- HowTo: Install VMWare Workstation on Fedora 8
- HowTo: Virtual PCLinux 2007 via VirtualBox over Fe...
- HowTo: Enable PortMap on Fedora 8
- HowTo: Linux Hardware Lister Tool - LsHw
- HowTo: Install Bandwidth Shaper - Trickle on Fedora
- HowTo: VnStat Long-Term Traffic Monitoring via CLI
- HowTo: Install NetSpeed Traffic Monitoring Applet
- HowTo: Install IPTraff LAN Monitoring Tool
- HowTo: Install Ibmonitor Interface Bandwidth Monitor
- HowTo: Install IfTop Bandwidth Monitoring Tool
- HowTo: Fedora WordPress Installation
-
▼
January
(49)
Friday, January 18, 2008
HowTo: Rebuild Locked Out RPM Database
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment