How to solve the problem of dpkg sub-process throwing a error in Ubuntu Back

  • Sometimes, you'll find that there's a error when using apt-get to install library. Like the follow:
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • Solution:
# backup the info directory
sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bak

# create a new directory
sudo mkdir /var/lib/dpkg/info

# update apt-get
sudo apt-get update

# install what you want to install
apt-get -f install xxx

# mv all the files under the new directory to the old backup
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bak

# remove the new directory
sudo rm -rf /var/lib/dpkg/info

# rename the backup info
sudo mv /var/lib/dpkg/info.bak /var/lib/dpkg/info
Empty Comments
Sign in GitHub

As the plugin is integrated with a code management system like GitLab or GitHub, you may have to auth with your account before leaving comments around this article.

Notice: This plugin has used Cookie to store your token with an expiration.