Home Linux Error “sub process /usr/bin/dpkg returned an error code″ in Ubuntu

Error “sub process /usr/bin/dpkg returned an error code″ in Ubuntu

I was trying to install MySQL-workbench and I got dpkg error. Help me!!!

One day, I was installing MySQL-workbench on my ubuntu system. But I got error “sub process /usr/bin/dpkg returned an error code 1” in Ubuntu. I searched a lot on google to find the solution for this. I gave a lot of time and finally, I found the solution for the dpkg error.

In this article, we let you know the solution with the help of the snapshots.

Sub-process /usr/bin/dpkg returned an error code
Sub-process /usr/bin/dpkg returned an error code

Why this Error ??

This error shows there is a problem with the software installer package or package is broken. On my Ubuntu machine, I was installing mysql-workbench and it threw me an error. As shown in the below screenshot.

When I saw last few lines of the error, I understood what is the issue. Then I did the following steps.

Method 1

Package Database Reconfigure

First, try this method. You can try to reconfigure the package database. Run the following command:

# sudo dpkg ––configure –a

If this method did not fix the problem, follow the next step.

Method 2

If any software is causing this error. Then you can remove that software by running the following command.

# sudo apt-get remove -f package_name

Where, -f = To remove package forcefully.

In my case, this solved the problem. MySql- Server package was causing this issue. I removed this package because this package was needed for me. Before removing any software, think twice. As per my suggestion take backup and then proceed. The safer side is always better.

Read More: How to Reset MySQL 5.7 Root User Password on CentOS 7.

Conclusion: You have learned how to fix the error “sub process /usr/bin/dpkg returned an error code 1″ Error in Ubuntu 16.04 and 18.04. For any feedback, kindly write in the below comment box.


Please enter your comment!
Please enter your name here