TL;DR
To fix “sub-process /usr/bin/dpkg returned an error code (1)” in Linux, try these four solutions:
- Fix broken dependencies and conflicts using the commands
sudo apt-get update && sudo apt-get install -f
. - Reinstall problematic packages by running the
sudo apt-get install --reinstall <package-name>
command. - Check and fix permission issues using the
sudo apt-get update
command. - Repair the package database by running
sudo apt-get clean && sudo apt-get update
followed by thesudo apt-get upgrade
command.
As this error can affect your system’s stability and performance, so try to avoid it by following the best practices. That includes keeping package dependencies up to date, using trusted package sources, and avoiding third-party software sources. Furthermore, use the root user account for system maintenance tasks and avoid manipulating system files unless necessary.
To know more about how to fix “sub-process /usr/bin/dpkg returned an error code (1)”, read the article below now.
When using the apt-get command to install or upgrade packages on Linux, you may experience the “sub-process /usr/bin/dpkg returned an error code (1)” error message. This error can be caused by package dependency issues, conflicts, corrupted package databases, or permission problems and can affect your system’s stability and performance. To quickly fix the error, I’ll walk you through four proven methods. And to avoid this issue in the future, I’ll also share best practices and advanced troubleshooting tips.
How to Fix “sub-process /usr/bin/dpkg returned an error code (1)” [4 Simple Ways]
To fix the “sub-process /usr/bin/dpkg returned an error code (1)” error on Linux, you can try the four methods: fix broken dependencies and conflicts, reinstall problematic packages, check and fix permission issues, and repair the package database. Here’s a breakdown of each method you can try to fix the error:
1. Fix Broken Dependencies and Conflicts
apt-get is a powerful tool for managing packages on your Linux system. This package is usually pre-installed and can help you resolve the “sub-process /usr/bin/dpkg returned an error code (1)” error. Here’s how you can use it to fix broken dependencies and conflicts:
- In the Terminal window, run the command below:
sudo apt-get update && sudo apt-get install -f
- This command updates the package database and installs any missing dependencies or packages that are causing conflicts. It may take some time, depending on the size of the package database and the number of packages that need to be installed.

- Once the command is complete, try running the original apt-get command that caused the sub-process /usr/bin/dpkg returned an error code (1) error in the first place.
- If the “sub-process /usr/bin/dpkg returned an error code (1)” error no longer occurs, the issue has been resolved. You can now proceed with installing or upgrading the packages you need. But if the error persists, try the next solution in this guide to resolve this issue.
2. Reinstall Problematic Packages
If the “sub-process /usr/bin/dpkg returned an error code (1)” error is caused by a specific package, consider reinstalling that particular package to fix this error. Here’s how you can do it:
- Head to the Terminal app and run any apt-related command.
- Review the error message displayed after the apt command execution. The error message will typically indicate the name of the package that is causing the issue.
- For example, if the error message indicates that the problematic package is called zsh, use
sudo apt-get install --reinstall <package-name>
. Your command should look like this:
sudo apt-get install --reinstall zsh
- Wait for the command to complete. It will take a few minutes to reinstall the problematic package and fix any issues with its dependencies.

- Once the command is complete, try running the original apt-get command again. If the error is still there, move on to the next method.
3. Check and Fix Permission Issues
Another solution to fix the “sub-process /usr/bin/dpkg returned an error code (1)” message is to check and fix the permission issues. To do so, follow the steps below:
- Launch the Terminal window and execute the command below:
sudo apt-get update
- This command updates the package database and checks for any permission issues that may be causing the error.

- Once the process is complete, run the original apt-get command again to see if the “sub-process /usr/bin/dpkg returned an error code (1)” message is fixed.
4. Repair the Package Database
Sometimes, this error may occur when the package database becomes corrupted or outdated. If that’s the case, you need to repair the package database. Here’s how to do it:
- Type the following command in the Terminal window and press Enter:
sudo apt-get clean && sudo apt-get update
- This command will clear the local repository of retrieved package files that are no longer needed and update the package database.

- Once the process is complete, execute the following command:
sudo apt-get upgrade
- This command will upgrade all installed packages on your Linux system to their latest versions.

- Once the command is complete, execute any of the apt-get commands to check whether the error is resolved or not.
4 Best Practices to Avoid the “sub-process /usr/bin/dpkg returned an error code (1)”
To avoid encountering the “sub-process /usr/bin/dpkg returned an error code (1)” message in the future, here are some best practices to follow:
- 🔄Keep your package dependencies up to date: Regularly updating your system and package dependencies can prevent conflicts and ensure smooth operation. Make sure to run the
sudo apt-get update
command regularly to update your package database and thesudo apt-get upgrade
command to upgrade installed packages to their latest versions. - 🔍Use trusted package sources: Only use trusted package sources to avoid potential conflicts and corrupted packages. The package sources provided by your Linux distribution are typically the most reliable and stable sources to use. You can also check the digital signature of packages using
sudo apt-key list
to get public keys and ensure their authenticity. - 🚫Avoid third-party software sources: Installing packages from third-party sources can introduce additional complexities and increase the likelihood of experiencing errors. If you do need to install a package from a third-party source, make sure it is a trusted source and follow any installation instructions carefully. To add a trusted package source on Linux, you can use the
sudo add-apt-repository universe
command. - 👑Use the root user account for system maintenance tasks: Only use the root user account to perform system maintenance tasks, such as installing or upgrading packages. This can help avoid permission issues and ensure that you have sufficient privileges to perform these tasks. However, it is important to be cautious when using the root user account, as it can also introduce security risks if used improperly.
Wrap-Up
Resolving the “sub-process /usr/bin/dpkg returned an error code (1)” error in Linux can be done using the four solutions outlined in this article. However, it’s important to follow best practices to avoid encountering this error in the future, such as keeping package dependencies up to date, using trusted package sources, and avoiding third-party software sources.
To learn more about Linux troubleshooting, be sure to check out our other articles on how to fix the held broken packages, install available updates before upgrades, and critical sudo bug CVE-2021-3156. With the right knowledge, practical solutions, and tools, you can keep your Linux system running smoothly and efficiently.
Frequently Asked Questions
What are the common causes of the “sub-process /usr/bin/dpkg returned an error code (1)” message?
The “sub-process /usr/bin/dpkg returned an error code (1)” message has several common causes, such as package dependency issues and conflicts, corrupted package databases, and permission issues. Conflicting dependencies can occur when trying to install multiple packages, while corrupted package databases can happen if the package manager is already running during an installation or upgrade. Permission issues can result from insufficient privileges when attempting to install or upgrade packages as a regular user instead of the root user.
How can I view the list of packages installed on my Linux machine?
You can use the apt list --installed command
to view the list of packages installed on your Linux machine. This command will display a list of all packages that are currently installed on your system, including their version numbers and other relevant details. This can be a useful way to get an overview of the packages installed on your system and ensure that you have the necessary dependencies for your applications.
Can I use a graphical package manager to fix this error?
Yes, many Linux distributions include graphical package managers that you can use to fix this error. However, the Linux command prompt methods outlined in this article are typically faster and more effective to resolve this error.
How can I search for a package using aptitude on my Linux machine?
To search for a package using aptitude
on your Linux machine, you can use the apt search
command followed by a keyword related to the package name. For example, if you want to search for a Python3
-related package, type apt search python3
in the Terminal. This will display a list of packages that match your search criteria, including their version numbers and other relevant details.
How do I check for package dependency issues in Linux?
You can check for package dependency issues in Linux by using the command sudo apt-get check
. This command will check for any missing dependencies or conflicts with installed packages on your Linux system. Then, you can apply the solutions based on the root cause of the problem.
How do I avoid permission issues when installing or upgrading packages in Linux?
You can avoid permission issues when installing or upgrading packages in Linux by using the root user account or using the sudo
command to elevate your privileges. It’s important to exercise caution when using elevated privileges to avoid accidentally modifying critical system files.