Ubuntu sub process/usr/bin/dpkg returned an error code (1) solution

When installing dependencies using the apt-get install directive, an error is reported as follows

dpkg: error processing tex-common (--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)

The solution is a three-step process:
The first step

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bak //First rename the info folder
sudo mkdir /var/lib/dpkg/info // Create a new info folder again
sudo apt-get update

The second step

apt-get -f install xxx  //Here xxx is replaced by the software to be installed
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bak

The third step

sudo rm -rf /var/lib/dpkg/info //Delete the new info folder you created
sudo mv /var/lib/dpkg/info.bak /var/lib/dpkg/info // change the name of the previous info folder back

So far the installation problem has been solved!

Read More: