{"id":4469,"date":"2015-01-04T13:29:02","date_gmt":"2015-01-04T13:29:02","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=4469"},"modified":"2015-01-04T13:29:02","modified_gmt":"2015-01-04T13:29:02","slug":"fix-broken-packages-in-ubuntu","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2015\/01\/fix-broken-packages-in-ubuntu\/","title":{"rendered":"How to Fix Broken Packages in Ubuntu [Quick Tip]"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/10\/Ubuntu-tips.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/10\/Ubuntu-tips.png\" alt=\"Ubuntu-tips\" width=\"250\" height=\"250\" class=\"aligncenter size-full wp-image-4141\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/10\/Ubuntu-tips.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2014\/10\/Ubuntu-tips-150x150.png 150w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>If a package installation fails in Ubuntu, it can cause a package manager to freeze or become locked. When you start Ubuntu Software Center, it asks you to press button to repair broken packages in your system, but it does not always work. <\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2015\/01\/fix-broken-packages.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2015\/01\/fix-broken-packages.jpg\" alt=\"Fix Broken Packages in Ubuntu\" width=\"600\" height=\"342\" class=\"aligncenter size-full wp-image-4470\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2015\/01\/fix-broken-packages.jpg 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2015\/01\/fix-broken-packages-300x171.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Here are a few tips show you how to fix broken packages in command line. To get started, open <b>terminal<\/b> from the Dash or by pressing Ctrl+Alt+T on keyboard:<\/p>\n<p>1. If a package installation fails due to dependencies issue, run below command in terminal:<\/p>\n<pre style=\"border:none;\">sudo apt-get -f install && sudo dpkg --configure -a<\/pre>\n<p>The command either solves the dependencies, or removes the package <i>(if dependencies unavailable)<\/i> automatically.<\/p>\n<p>2. If a problem occurs with MergeList, appearing as a missing &#8220;Package: header&#8221; error:<\/p>\n<blockquote><p>E: Encountered a section with no Package: header<br \/>\nE: Problem with MergeList&#8230;<br \/>\nE: The package lists or status file could not be parsed or opened.<\/p><\/blockquote>\n<p>Then remove the package lists and recreate one:<\/p>\n<pre style=\"border:none;\">sudo rm \/var\/lib\/apt\/lists\/* -vf\n\nsudo apt-get update<\/pre>\n<p>3. If a problem occurs with a lock on the apt cache, for example:<\/p>\n<blockquote><p>E: Could not get lock \/var\/cache\/apt\/archives\/lock &#8211; open (11: Resource temporarily unavailable)<\/p><\/blockquote>\n<p>Then delete the locks by running below commands one by one:<\/p>\n<pre style=\"border:none;\">sudo fuser -cuk \/var\/lib\/dpkg\/lock \n\nsudo rm -f \/var\/lib\/dpkg\/lock\n\nsudo fuser -cuk \/var\/cache\/apt\/archives\/lock\n\nsudo rm -f \/var\/cache\/apt\/archives\/lock<\/pre>\n<p>If you have some more tips to fix broken packages in Ubuntu Linux, please don&#8217;t hesitate to leave a comment here.<\/p>","protected":false},"excerpt":{"rendered":"<p>If a package installation fails in Ubuntu, it can cause a package manager to freeze or become locked. When you start Ubuntu Software Center, it asks you to press button to repair broken packages in your system, but it does not always work. Here are a few tips show you how to fix broken packages [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1202],"class_list":["post-4469","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-fix-broken-packages"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/4469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=4469"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/4469\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=4469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=4469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=4469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}