{"id":1690,"date":"2018-10-26T07:45:16","date_gmt":"2018-10-26T07:45:16","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=1690"},"modified":"2018-10-26T08:29:02","modified_gmt":"2018-10-26T08:29:02","slug":"solvedsubprocessusrbindpkgreturnedanerrorcodeerrorinubuntu","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/26\/solvedsubprocessusrbindpkgreturnedanerrorcodeerrorinubuntu\/","title":{"rendered":"[Solved] \u201csub process usr bin dpkg returned an error code 1\u2033 Error in Ubuntu"},"content":{"rendered":"<p>Last updated August 24, 2018<\/p>\n<p>If you are encountering \u201csub process usr bin dpkg returned an error code 1\u201d while installing software on Ubuntu Linux, here is how you can fix it. One of the common issue in Ubuntu and other Debian based distribution is the broken packages. You try to update the system or install a new package and you encounter an error like \u2018Sub-process \/usr\/bin\/dpkg returned an error code\u2019.<\/p>\n<p>That\u2019s what happened to me the other day. I was trying to install a radio application in Ubuntu when it threw me this error:<\/p>\n<p>Unpacking python-gst-1.0 (1.6.2-1build1) &#8230;<br \/>\nSelecting previously unselected package radiotray.<br \/>\nPreparing to unpack &#8230;\/radiotray_0.7.3-5ubuntu1_all.deb &#8230;<br \/>\nUnpacking radiotray (0.7.3-5ubuntu1) &#8230;<br \/>\nProcessing triggers for man-db (2.7.5-1) &#8230;<br \/>\nProcessing triggers for desktop-file-utils (0.22-1ubuntu5.2) &#8230;<br \/>\nProcessing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) &#8230;<br \/>\nRebuilding \/usr\/share\/applications\/bamf-2.index&#8230;<br \/>\nProcessing triggers for gnome-menus (3.13.3-6ubuntu3.1) &#8230;<br \/>\nProcessing triggers for mime-support (3.59ubuntu1) &#8230;<br \/>\nSetting up polar-bookshelf (1.0.0-beta56) &#8230;<br \/>\nln: failed to create symbolic link &#8216;\/usr\/local\/bin\/polar-bookshelf&#8217;: No such file or directory<br \/>\ndpkg: error processing package polar-bookshelf (&#8211;configure):<br \/>\nsubprocess installed post-installation script returned error exit status 1<br \/>\nSetting up python-appindicator (12.10.1+16.04.20170215-0ubuntu1) &#8230;<br \/>\nSetting up python-gst-1.0 (1.6.2-1build1) &#8230;<br \/>\nSetting up radiotray (0.7.3-5ubuntu1) &#8230;<br \/>\nErrors were encountered while processing:<br \/>\npolar-bookshelf<br \/>\nE: Sub-process \/usr\/bin\/dpkg returned an error code (1)<\/p>\n<p>The last three lines are of the utmost importance here.<\/p>\n<p>Errors were encountered while processing:<br \/>\npolar-bookshelf<br \/>\nE: Sub-process \/usr\/bin\/dpkg returned an error code (1)<\/p>\n<p>It tells me that the package polar-bookshelf is causing and issue. This might be crucial to how you fix this error here.<\/p>\n<h2>Fixing Sub-process \/usr\/bin\/dpkg returned an error code (1)<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/4bds6hergc-flywheel.netdna-ssl.com\/wp-content\/uploads\/2018\/08\/fix-common-update-errors-ubuntu.jpeg\" alt=\"Fix update errors in Ubuntu Linux\" width=\"800\" height=\"450\" \/><\/p>\n<p>Let\u2019s try to fix this broken error package. I\u2019ll show several methods that you can try one by one. The initial ones are easy to use and simply no-brainers.<\/p>\n<p>You should try to run sudo apt update and then try to install a new package or upgrade after trying each of the methods discussed here.<\/p>\n<h3>Method 1: Reconfigure Package Database<\/h3>\n<p>The first method you can try is to reconfigure the package database. Probably the database got corrupted while installing a package. Reconfiguring often fixes the problem.<\/p>\n<p>sudo dpkg &#8211;configure -a<\/p>\n<h3>Method 2: Use force install<\/h3>\n<p>If a package installation was interrupted previously, you may try to do a force install.<\/p>\n<p>sudo apt-get install -f<\/p>\n<h3>Method 3: Try removing the troublesome package<\/h3>\n<p>If it\u2019s not an issue for you, you may try to remove the package manually. Please don\u2019t do it for Linux Kernels (packages starting with linux-).<\/p>\n<p>sudo apt remove<\/p>\n<h3>Method 4: Remove post info files of the troublesome package<\/h3>\n<p>This should be your last resort. You can try removing the files associated to the package in question from \/var\/lib\/dpkg\/info.<\/p>\n<p><em>You need to know a little about basic Linux commands to figure out what\u2019s happening and how can you use the same with your problem.<\/em><\/p>\n<p>In my case, I had an issue with polar-bookshelf. So I looked for the files associated with it:<\/p>\n<p>ls -l \/var\/lib\/dpkg\/info | grep -i polar-bookshelf<br \/>\n-rw-r&#8211;r&#8211; 1 root root 2324811 Aug 14 19:29 polar-bookshelf.list<br \/>\n-rw-r&#8211;r&#8211; 1 root root 2822824 Aug 10 04:28 polar-bookshelf.md5sums<br \/>\n-rwxr-xr-x 1 root root 113 Aug 10 04:28 polar-bookshelf.postinst<br \/>\n-rwxr-xr-x 1 root root 84 Aug 10 04:28 polar-bookshelf.postrm<\/p>\n<p>Now all I needed to do was to remove these files:<\/p>\n<p>sudo mv \/var\/lib\/dpkg\/info\/polar-bookshelf.* \/tmp<\/p>\n<p>Use the sudo apt update and then you should be able to install software as usual.<\/p>\n<h3>Which method worked for you (if it worked)?<\/h3>\n<p>I hope this quick article helps you in fixing the \u2018E: Sub-process \/usr\/bin\/dpkg returned an error code (1)\u2019 error. If it did work for you, which method was it? Did you manage to fix this error with some other method? If yes, please share that to help others with this issue.<\/p>\n<p><a href=\"https:\/\/itsfoss.com\/dpkg-returned-an-error-code-1\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last updated August 24, 2018 If you are encountering \u201csub process usr bin dpkg returned an error code 1\u201d while installing software on Ubuntu Linux, here is how you can fix it. One of the common issue in Ubuntu and other Debian based distribution is the broken packages. You try to update the system or &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/26\/solvedsubprocessusrbindpkgreturnedanerrorcodeerrorinubuntu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;[Solved] \u201csub process usr bin dpkg returned an error code 1\u2033 Error in Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1690","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1690","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=1690"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1690\/revisions"}],"predecessor-version":[{"id":1738,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/1690\/revisions\/1738"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=1690"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=1690"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=1690"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}