{"id":864,"date":"2011-03-15T13:45:03","date_gmt":"2011-03-15T18:45:03","guid":{"rendered":"http:\/\/www.gamescheat.ca\/?p=864"},"modified":"2019-09-04T19:57:39","modified_gmt":"2019-09-05T00:57:39","slug":"troubleshoot-problem-with-yum-update-and-rebuild-the-rpm-database","status":"publish","type":"post","link":"http:\/\/www.gamescheat.ca\/?p=864","title":{"rendered":"Troubleshoot problem with yum update and rebuild the rpm database"},"content":{"rendered":"<p>I have created a step by step approach to troubleshoot a problem with performing yum update and how to rebuild the rpm database.<\/p>\n<p>I received and error while trying to update the Redhat Enterprise 5 server kernel using yum update.  Looking at the output of yum update it seems that the dependency mkinitrd was missing.  <\/p>\n<blockquote><p># yum update<br \/>\nLoaded plugins: rhnplugin, security<br \/>\nSkipping security plugin, no data<br \/>\nSetting up Update Process<br \/>\nResolving Dependencies<br \/>\nSkipping security plugin, no data<br \/>\n\u2013> Running transaction check<br \/>\n\u2014> Package kernel.i686 0:2.6.18-238.5.1.el5 set to be installed<br \/>\n\u2013> Processing Dependency: mkinitrd >= 4.2.21-1 for package: kernel<br \/>\n\u2013> Finished Dependency Resolution<br \/>\nkernel-2.6.18-238.5.1.el5.i686 from rhel-i386-server-5 has depsolving problems<br \/>\n  \u2013> Missing Dependency: mkinitrd >= 4.2.21-1 is needed by package kernel-2.6.18-238.5.1.el5.i686 (rhel-i386-server-5)<br \/>\nError: Missing Dependency: mkinitrd >= 4.2.21-1 is needed by package kernel-2.6.18-238.5.1.el5.i686 (rhel-i386-server-5)<br \/>\n You could try using \u2013skip-broken to work around the problem<br \/>\n You could try running: package-cleanup \u2013problems<br \/>\n                        package-cleanup \u2013dupes<br \/>\n                        rpm -Va \u2013nofiles \u2013nodigest<\/p><\/blockquote>\n<p>I tried the suggested fix by running the commands package-cleanup.  But that did not resolve the problem.  I then tried clear all yum cache and to re-synch with the Red Hat Network Satellite server.  But yum update failed with the same error.<\/p>\n<blockquote><p># rm -rf \/var\/cache\/yum\/*<br \/>\n# yum clean all<!--more--><br \/>\n# rhn-profile-sync<br \/>\n# yum update<\/p><\/blockquote>\n<p>The next logical thing to do was to check and see if mkinitrd was installed, and it was.<\/p>\n<blockquote><p># rpm -q mkinitrd<br \/>\nmkinitrd-5.1.19.6-68.el5<\/p><\/blockquote>\n<p>Now I was really puzzled, if the dependency was installed then was it healthy? Using the rpm \u2013Va command I found out that mkinitrd was missing the dependency nash.<\/p>\n<blockquote><p># rpm -Va mkinitrd<br \/>\nUnsatisfied dependencies for mkinitrd-5.1.19.6-68.el5.i386: config(mkinitrd) = 5.1.19.6-68.el5, nash = 5.1.19.6-68.el5, mkinitrd<\/p><\/blockquote>\n<p>Following the trail, I checked to see if nash was installed, and it was.<\/p>\n<blockquote><p># rpm \u2013q nash<br \/>\nnash-5.1.19.6-68.el5<\/p><\/blockquote>\n<p>Is nash healthy? No result means no fault found.<\/p>\n<blockquote><div style=\"float: right;\"><div style=\"margin: 15px 15px 15px 15px\";><script type=\"text\/javascript\"><!--\ngoogle_ad_client = \"pub-3319935785736004\";\ngoogle_alternate_color = \"FFFFFF\";\ngoogle_ad_width = 234;\ngoogle_ad_height = 60;\ngoogle_ad_format = \"234x60_as\";\ngoogle_ad_type = \"text_image\";\ngoogle_ad_channel =\"\";\ngoogle_color_border = \"cccccc\";\ngoogle_color_link = \"cc0000\";\ngoogle_color_bg = \"ffffff\";\ngoogle_color_text = \"000000\";\ngoogle_color_url = \"008000\";\n\/\/--><\/script>\n<script type=\"text\/javascript\"\n  src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\n<\/script><\/div><\/div><p># rpm -Va nash<\/p><\/blockquote>\n<p>If mkinitrd claims that it is dependent on nash, then checking to see what requires nash should result in mkinitrd.  But I did not receive any result back on the check.<\/p>\n<blockquote><p># rpm -q \u2013whatrequires nash<\/p><\/blockquote>\n<p>Now I was stumped, if mkinitrd says that it was dependant on nash, then why is nash not reporting that mkinitrd requires it?  Using the rpm \u2013q \u2013whatrequires I checked to see what required mkinitrd.<\/p>\n<blockquote><p># rpm -q \u2013whatrequires mkinitrd<br \/>\nmkbootdisk-1.5.3-2.1<br \/>\nsystem-config-kdump-1.0.14-4.el5<br \/>\nkernel-2.6.18-194.17.1.el5<\/p><\/blockquote>\n<p>I compared the result of rpm \u2013q \u2013whatrequires nash to different installation of Redhat.  Below is what the result should be.<\/p>\n<blockquote><p># rpm -q \u2013whatrequires nash<br \/>\nmkinitrd-5.1.19.6-68.el5<\/p><\/blockquote>\n<p>To sum it up, the kernel cannot be updated because it is missing the dependency mkinitrd.  Mkinitrd is installed but not healthy because it is missing the dependency nash.  Nash is installed and healthy which contradicts the former statement.  Therefore there is nothing wrong with mkinitrd or nash, the problem then lies with the yum cache or rpm database.  I already ran yum clean all to clear all yum cache and headers, it did not resolve the issue.  The logical answer is that the rpm database is corrupted and requires a rebuild.<\/p>\n<p>It may be beneficial to backup the current rpm databases before deleting.  The rpm database are in \/var\/lib\/rpm.  It is also recommended that rebuidling be done in single user mode, although I did it successfully in init 3 run level.<\/p>\n<p>Delete the lock files.<\/p>\n<blockquote><p># rm \u2013f \/var\/lib\/rpm\/__db*<\/p><\/blockquote>\n<p>Rebuild the database<\/p>\n<blockquote><p># rpm \u2013rebuilddb<\/p><\/blockquote>\n<p>You can also use the -vv option for verbose mode.<\/p>\n<blockquote><p># rpm -vv \u2013rebuilddb<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I have created a step by step approach to troubleshoot a problem with performing yum update and how to rebuild the rpm database. I received and error while trying to update the Redhat Enterprise 5 server kernel using yum update.&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.gamescheat.ca\/?p=864\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[55,77],"_links":{"self":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/864"}],"collection":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=864"}],"version-history":[{"count":18,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/864\/revisions"}],"predecessor-version":[{"id":961,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=\/wp\/v2\/posts\/864\/revisions\/961"}],"wp:attachment":[{"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=864"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gamescheat.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}