How To Fix “Sub-process /usr/bin/dpkg returned an error code (1)” Error In Ubuntu
You might come across the “Sub-process /usr/bin/dpkg returned an error code (1)” Error In Ubuntu while trying to install software or upgrade the Ubuntu. This happens because of corrupt or broken packages. Sometimes a broken package might interrupt your Ubuntu upgrading process.
Errors were encountered while processing: firefox E: Sub-process /usr/bin/dpkg returned an error code (1)
This indicates that the firefox package is either broken or corrupt.
Let’s have a look into the solution for this.
How To Fix “Sub-process /usr/bin/dpkg returned an error code (1)” Error In Ubuntu
Method 1:
Purge the Bad or Corrupted Software Package
Run the following command to remove or purge the software package that is creating an issue.
sudo apt remove --purge package_name
sudo apt remove --purge firefox
Now, run the following command to remove all the old, unused, and unnecessary packages.
sudo apt clean sudo apt autoremove
Method 2:
Reconfiguring the dpkg Package
Run the following command to reconfigure the packages.
sudo dpkg --configure -a
- How To Fix ‘Got permission denied while trying to connect to the Docker daemon socket’ Error In Ubuntu 22.04 LTS
- How To Fix Mount Point Does Not Exist Error In Linux
- How to Fix /bin/rm: cannot execute [Argument list too long]
- Fix “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”
- How To Fix curl: (6) Could not resolve host Error in Linux
Method 3:
Remove all the Files Associated with the Package
Run the following command to remove all the files associated with the troublesome package.
Run the following command to find these files which are located in the /var/lib/dpkg/info directory as shown.
sudo ls -l /var/lib/dpkg/info | grep -i package_name
Move them to the /tmp directory with the following command:
sudo mv /var/lib/dpkg/info/package-name.* /tmp
Or run the following command to manually remove the files.
sudo rm -r /var/lib/dpkg/info/package-name.*
Method 4:
Force Install the Troublesome Package
Run the following command to force install the package using the -f
option as shown.
sudo apt install -f
OR
sudo apt install --fix-broken