Pular para o conteúdo principal

How to Fix sub-process /usr/bin/dpkg returned an error code (1)

Introduction

The error message “Sub-process /usr/bin/dpkg returned an error code (1)” indicates a problem with the package installer. This can happen in Ubuntu after a failed software installation, or if the installer becomes corrupted.
The key phrase in this error is /usr/bin/dpkg. This refers to the dpkg package installer for Linux. A package installer is an application that tracks software, updates, and dependencies. If it is damaged, any new software installation will cause this error message.
We cover several possible solutions, from easily-solved and straightforward solutions to more complex processes. This guide will help you resolve the dpkg returned an error code 1 on an Ubuntu operating system.
how to fix subprocess error code



Prerequisites

Options to Fix sub-process /usr/bin/dpkg returned an error code (1)

sub-process returned an error code ubuntu update

Method 1: Reconfigure dpkg Database

If your package database has become corrupted, reconfiguring it can repair it.
Enter the following command:
sudo dpkg ––configure –a
This command reconfigures packages that have been unpacked but not necessarily installed. An interruption at the wrong time can cause this database to become corrupt. This is especially helpful if you were running installation and the process was interrupted.

Method 2: Force-Install the Software

If Method 1 does not work, you can attempt to fix the dependencies in the package installer.
Enter the following:
sudo apt-get install –f
The –f option means fix-broken. It repairs any broken dependencies in your package manager. Broken dependencies occur when a download is interrupted, or there is a problem with the cached download.

Note: Dependencies are other software packages that are required by the software you are installing. A package manager helps keep track of dependencies for you.

Method 3: Remove Bad Software Package

If you know which software caused the errors on your system, you can remove it.
Enter the command and package_name with the name of the software that is causing the problem:
sudo apt-get remove ––purge package_name
The ––purge option directs the system to remove config files in addition to uninstalling. This helps get rid of all traces of the offending software.


Method 4: Clean Out Unused Software Packages

If an old, outdated, or unused package is causing the problem, you can solve the problem by removing unused software packages.
Enter the following command in the terminal:
sudo apt autoremove

Note: Avoid the next 2 options unless all other methods have failed.

Method 5: Remove Post Files

If you know the name of the package that is causing problems, you can delete the files manually. The installation files are usually located in the /var/lib/dpkg/info file.
Type in the following command and replace package_name with the name of the broken software.:
sudo ls –l /var/lib/dpkg/info | grep –i package_name
This will generate a list of all references to the software you installed.
You can then remove them by entering:
sudo mv /var/lib/dpkg/info/package_name.* /tmp
This command moves the files to the /tmp directory, where they cannot affect your package manager.
Next, update the package manager:
sudo apt-get update
After which you can re-install the broken software again.

Method 6: Overwrite Package File

If you know the name of the package that is causing a problem, you can force an overwrite.
Use the following command and replace full_name_of_package with the actual package name:
sudo dpkg –i ––force–overwrite /var/cache/apt/archives/full_name_of_package

Note: If you do not know the actual name of the package, you can search for it with the following command:
ls /var/cache/apt/archies/*package_name*

Replace package_name with the name of your software. This should return any instances of that package name. Note the exact filename, and type it into the previous command.

Conclusion
The dpkg error message indicates that there is a problem with the package installer, which is  commonly caused by an interrupted installation process or a corrupted database.
By following these steps, you should now have several methods to fix the dpkg error message and attain a working package installer.

Comentários

Postagens mais visitadas deste blog

Upgrading Iomega ix2-200 to Cloud Edition

You just got your ix2-200 from eBay and there are no disks inside the NAS. Or you have a brand new ix2-200 -yet you could not afford Cloud Edition. No problem. With just a USB stick and a SATA adapter or desktop PC, you will easily upgrade your ix2-200 to ix2-200 Cloud Edition. Not only your ix2-200 will have a brand new interface and Cloud options, but also will become Mac OS X Lion compatible! What do we need? Decrypted! ix2-200 Cloud Edition Firmware 3.1.12.47838 S endSpace or RapidShare * USB Flash Drive with at least 2 GB capacity and LED indicator** SATA to USB adapter or desktop PC Toothpick or paperclip Preparing Hard Drives Preparing hard drives is the first step because you have to wipe all the data inside the hard drives and make them just like brand new. We used 2 x Seagate 2 TB 5900 RPM Drives. Backup any files if you have and then remove both disks from ix2-200 and attach them to SATA to USB adapter or your desktop PC's SATA port. Using

Cuckoo com Vmware Esxi

Cuckoo is an open-source malware analysis platform using sandboxing technology. The tool allows people like us to analyze malicious binaries in an isolated environment. Since Cuckoo is commonly used with Oracle VirtualBox as its virtualization platform, a majority of online documentation is focused on configuration using VirtualBox. PlantainStan and I decided to test running Cuckoo on ESXi and document our success. This guide will help with the basic configuration of ensuring Cuckoo properly interacts with ESXi. We will continue to update this post as we make continue to make an even more baller Cuckoo environment! Note: In order to successfully interact with vSphere's API, you will need the VMWare ESX Standard license. API functionality is required for Cuckoo to work with ESX. Configure ESX Since this guide is not a "how to" on installing ESXi, we will assume that you have successfully installed the hypervisor on your system. There

CentOS7 with Snort Barnyard2 Snorby PulledPork SElinux

This post is about how to install Snort "stack" on CentOS7 with potentially all the latest libs an stuff. Here I will install and configure everything to run Snort as IDS. I will write another post shortly how to run it as IPS - INLINE. System details: [ root@nfsec-ids-01 ~ ] # cat /etc/redhat-release CentOS Linux release 7.3.1611 ( Core ) [ root@nfsec-ids-01 ~ ] # uname -a Linux nfsec-ids-01.nfsec.co.uk 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Snort 2.9.9.0 Installation of snort is very basic: yum install https://www.snort.org/downloads/snort/daq-2.0.6-1.centos7.x86_64.rpm yum install https://www.snort.org/downloads/snort/snort-2.9.9.0-1.centos7.x86_64.rpm Register at Snort and download registered rule set: mkdir /usr/local/src/snortrules cd /usr/local/src/snortrules wget https://www.snort.org/rules/snortrules-snapshot-2990.tar.gz?oinkcode = < oinkcode > tar -zxvf snort