{"id":470,"date":"2010-01-11T14:11:44","date_gmt":"2010-01-11T18:11:44","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=470"},"modified":"2013-03-20T08:42:25","modified_gmt":"2013-03-20T12:42:25","slug":"yum-update-error-rpmdb-open-failed","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/yum-update-error-rpmdb-open-failed","title":{"rendered":"Yum update. Error: rpmdb open failed"},"content":{"rendered":"<p>The &#8220;rpmdb open failed&#8221; error message is mostly received when the rpm databases __db.00* located under \/var\/lib\/rpm directory are corrupted. This results in a &#8220;error: cannot open Packages database&#8221; message while installation\/updatation of a package via yum.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>root@server [~]# yum update<br \/>\nLoaded plugins: fastestmirror<br \/>\nerror: no dbpath has been set<br \/>\nerror: cannot open Packages database in \/%{_dbpath}<br \/>\nTraceback (most recent call last):<br \/>\nFile &#8220;\/usr\/bin\/yum&#8221;, line 29, in ?<br \/>\nyummain.user_main(sys.argv[1:], exit_code=True)<br \/>\nFile &#8220;\/usr\/share\/yum-cli\/yummain.py&#8221;, line 309, in user_main<br \/>\nerrcode = main(args)<br \/>\nFile &#8220;\/usr\/share\/yum-cli\/yummain.py&#8221;, line 157, in main<br \/>\nbase.getOptionsConfig(args)<br \/>\nFile &#8220;\/usr\/share\/yum-cli\/cli.py&#8221;, line 187, in getOptionsConfig<br \/>\nself.conf<br \/>\nFile &#8220;\/usr\/lib\/python2.4\/site-packages\/yum\/__init__.py&#8221;, line 664, in &lt;lambda&gt;<br \/>\nconf = property(fget=lambda self: self._getConfig(),<br \/>\nFile &#8220;\/usr\/lib\/python2.4\/site-packages\/yum\/__init__.py&#8221;, line 239, in _getConfig<br \/>\nself._conf = config.readMainConfig(startupconf)<br \/>\nFile &#8220;\/usr\/lib\/python2.4\/site-packages\/yum\/config.py&#8221;, line 804, in readMainConfig<br \/>\nyumvars[&#8216;releasever&#8217;] = _getsysver(startupconf.installroot, startupconf.distroverpkg)<br \/>\nFile &#8220;\/usr\/lib\/python2.4\/site-packages\/yum\/config.py&#8221;, line 877, in _getsysver<br \/>\nidx = ts.dbMatch(&#8216;provides&#8217;, distroverpkg)<br \/>\nTypeError: rpmdb open failed<\/strong><\/span><\/p>\n<p>The common fix is to delete the rpm databases and run rebuilddb, like<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong># yum clean all<br \/>\n# rm -f \/var\/lib\/rpm\/__db*<br \/>\n# rpm &#8211;rebuilddb<br \/>\n# yum update<\/strong><\/span><\/p><\/blockquote>\n<p>However, in case of a VPS, yum may still not work with rebuilding rpm database and you have to try create a \/dev\/urandom device. Login to your VPS and execute<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong># rm \/dev\/urandom<br \/>\n# mknod -m 644 \/dev\/urandom c 1 9<\/strong><\/span><\/p><\/blockquote>\n<p>The problem may reoccur on a VPS reboot so to fix the problem permanently, login to Hardware Node and execute:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong># vzctl stop VEID<br \/>\n# mknod &#8211;mode 644 \/vz\/private\/VEID\/fs\/root\/dev\/urandom c 1 9<br \/>\n# vzctl start VEID<\/strong><\/span><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;rpmdb open failed&#8221; error message is mostly received when the rpm databases __db.00* located under \/var\/lib\/rpm directory are corrupted. This results in a &#8220;error: cannot open Packages database&#8221; message while installation\/updatation of a package via yum.<br \/>\nroot@server [~]# yum update<br \/>\nLoaded plugins: fastestmirror<br \/>\nerror: no dbpath has been set<br \/>\nerror: cannot open Packages database in \/%{_dbpath}<br \/>\nTraceback (most recent call last):<br \/>\nFile &#8220;\/usr\/bin\/yum&#8221;, line 29, in ?<br \/>\nyummain.user_main(sys.argv[1:], exit_code=True)<br \/>\nFile &#8220;\/usr\/share\/yum-cli\/yummain.py&#8221;, line 309, in user_main<br \/>\nerrcode = main(args)<br \/>\nFile &#8220;\/usr\/share\/yum-cli\/yummain.py&#8221;, line 157, in main<br \/>\nbase.getOptionsConfig(args)<br \/>\nFile &#8220;\/usr\/share\/yum-cli\/cli.py&#8221;, line 187, in getOptionsConfig<br \/>\nself.conf<br \/>\nFile &#8220;\/usr\/lib\/python2.4\/site-packages\/yum\/__init__.py&#8221;, line 664, in &lt;lambda&gt;<br \/>\nconf = property(fget=lambda self: [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[645,641,644,647,646,642,643,648,640],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/470"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=470"}],"version-history":[{"count":4,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":2192,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/470\/revisions\/2192"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}