Today when I used the command to install the program in the terminal, the following error message appeared.
E: Sub-process /usr/bin/dpkg returned an error code (1)
In this case, whatever program is installed will eventually report this error. The specific error screenshot is shown in the figure below.
To solve this problem, first use the following command to enter the corresponding directory.
cd /var/lib/dpkg/
The files contained in this directory are shown below.
First use the following command to rename the original info file in the folder.
sudo mv info info_temp
The execution process is shown in the figure below.
Then use the following command to create a new folder named info.
sudo mkdir info
Then use the following command to update apt-get.
sudo apt-get update
Update the information printed by apt-get as shown below.
Then use the command below to force a repair.
sudo apt-get -f install
The information printed during the repair process is shown in the figure below.
At this time, check the newly created info folder. A file named format has been generated in it, as shown in the figure below.
Use the following command to move the files generated under info to the original folder, which is under info_temp.
sudo mv info/* info_temp/
Then use the following command to delete the newly created folder info.
sudo rm -rf info
Then use the following command to change the name of the original folder back to info.
sudo mv info_temp info
Now that all the operations have been completed, let’s try installing the program again.
The results are shown below.
There is no error message "E: Sub-process /usr/bin/dpkg returned an error code (1)", and the problem has been solved!
Summary of instructions to resolve this error:
cd /var/lib/dpkg/
sudo mv info info_temp
sudo mkdir info
sudo apt-get update
sudo apt-get -f install
sudo mv info/* info_temp/
sudo rm -rf info
sudo mv info_temp info
The above is the solution to the installation program error "E: Sub-process /usr/bin/dpkg returned an error code (1)"!