1. Home
  2. Linux
  3. Fix Sub-Process /usr/bin/dpkg returned an error code(1)

Fix Sub-Process /usr/bin/dpkg returned an error code(1)

I encountered an error “Sub-Process /usr/bin/dpkg returned an error code (1)” while installing a Single sign-on package called Gluu Server. Below is the snapshot of the error.

# apt-get install gluu-server-3.1.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
Setting up gluu-server-3.1.3 (1.8~trusty+Ub14.04) ...
update-rc.d: /etc/init.d/gluu-server-3.1.3: file does not exist
dpkg: error processing package gluu-server-3.1.3 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

So how to fix this issue? Here we go,

How to fix Sub-Process /usr/bin/dpkg returned an error code (1) while installing Gluu Server

It’s one of the common error thrown by dpkg package manager.

Step 1: First thing a package manager does is configure package database, which contains installed packages information. If a package installation is interrupted, then this database may have become corrupt. So let’s reconfigure the package database.

Re-configure Package Database

Execute the below command to repair and reconfigure the package database:

# sudo dpkg --configure -a

Step 2: Some of the packages may be cached, because of which the installation may be interrupted.

Install forcefully

Execute the below command to install a package forcefully:

# sudo apt-get install -f <package-name>

Step 3: Remove unwanted packages installed previously which might be affecting the package installation.

Auto-remove unwanted packages

Execute the below command to remove unwanted packages installed previously. This is a safe command which will clean cache for unused packages.

# sudo apt-get autoremove

That’s it. Now the package installed without any problem.

# apt-get install gluu-server-3.1.3
Updated on July 19, 2018

Was this article helpful?

Related Articles

Add A Comment