For the past week or two, every time I installed new software into Ubuntu, I was greeted with the “Errors were encountered while processing:” blah, blah, blah speech.
Up until yesterday, that error was just a battle scar my computer had earned attempting to install a few software packages. I didn’t need them, my computer wasn’t bothered by them not being fully installed so after trying to fix them many times I thought f#ck it! No real problem. But yesterday, when a few more packages failed to install, and this time they stopped my computer from updating itself and prevented me from using Synaptic, I decided enough is enough, I’m going to fix it once and for all. So, I tooled up, got out my best keyboard, readied my fastest mouse, donned my Linux badges and set out on my quest to kill the Big Bad Bug, save the princess and live happily ever after…. sorry, got a little carried away there.
Today, I completed my quest – I squished that bug and watched his juices spit all over my computer’s insides as it made that squelchy noise only squished bugs know how to make so well.

The next time you find you cannot add software into your Ubuntu distro because you’re getting errors that look like or totally unlike this one:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 38 not upgraded. 4 not fully installed or removed. Need to get 0B/590kB of archives. After this operation, 0B of additional disk space will be used. WARNING: The following packages cannot be authenticated! python-distutils-extra scons Authentication warning overridden. Selecting previously deselected package python-distutils-extra. (Reading database ... 458474 files and directories currently installed.) Preparing to replace python-distutils-extra 2.12 (using .../python-distutils-extra_2.12_all.deb) ... dpkg (subprocess): unable to execute old pre-removal script: Exec format error dpkg: warning: old pre-removal script returned error exit status 2 dpkg - trying script from the new package instead ... Traceback (most recent call last): File "/usr/bin/pycentral", line 2196, in <module> main() File "/usr/bin/pycentral", line 2190, in main rv = action.run(global_options) File "/usr/bin/pycentral", line 1645, in run pkg = DebPackage('package', self.args[0], oldstyle=False) File "/usr/bin/pycentral", line 381, in __init__ self.read_pyfiles() File "/usr/bin/pycentral", line 414, in read_pyfiles self.pkgconfig.set('pycentral', 'include-links', '0') File "/usr/lib/python2.6/ConfigParser.py", line 669, in set ConfigParser.set(self, section, option, value) File "/usr/lib/python2.6/ConfigParser.py", line 377, in set raise NoSectionError(section) ConfigParser.NoSectionError: No section: 'pycentral' dpkg: error processing /var/cache/apt/archives/python-distutils-extra_2.12_all.deb (--unpack): subprocess new pre-removal script returned error exit status 1 dpkg (subprocess): unable to execute installed post-installation script: Exec format error dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 2 Preparing to replace scons 1.2.0-2ubuntu1 (using .../scons_1.2.0-2ubuntu1_all.deb) ... dpkg (subprocess): unable to execute old pre-removal script: Exec format error dpkg: warning: old pre-removal script returned error exit status 2 dpkg - trying script from the new package instead ... Traceback (most recent call last): File "/usr/bin/pycentral", line 2196, in <module> main() File "/usr/bin/pycentral", line 2190, in main rv = action.run(global_options) File "/usr/bin/pycentral", line 1645, in run pkg = DebPackage('package', self.args[0], oldstyle=False) File "/usr/bin/pycentral", line 381, in __init__ self.read_pyfiles() File "/usr/bin/pycentral", line 414, in read_pyfiles self.pkgconfig.set('pycentral', 'include-links', '0') File "/usr/lib/python2.6/ConfigParser.py", line 669, in set ConfigParser.set(self, section, option, value) File "/usr/lib/python2.6/ConfigParser.py", line 377, in set raise NoSectionError(section) ConfigParser.NoSectionError: No section: 'pycentral' dpkg: error processing /var/cache/apt/archives/scons_1.2.0-2ubuntu1_all.deb (--unpack): subprocess new pre-removal script returned error exit status 1 dpkg (subprocess): unable to execute installed post-installation script: Exec format error dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 2 Errors were encountered while processing: /var/cache/apt/archives/python-distutils-extra_2.12_all.deb /var/cache/apt/archives/scons_1.2.0-2ubuntu1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) |
Use these steps to fix them:
Firstly, make a note of the applications that refuse to install then try one or more of the usual hit-n-stab gambits before pulling out your longsword and making more extensive blood letting cuts into your system:
- ensure that the shared libraries are properly registered (also fixes some GCC/G++ errors)
|
1 |
sudo ldconfig |
- try to remove the package (replace ‘your-app’ with the name of the dodgy application)
|
1 |
sudo dpkg -r YOUR-APP |
- check your package cache
|
1 |
sudo apt-get check |
- update your package list
|
1 |
sudo apt-get update |
- ensure package downloads were properly completed when the system last updated
|
1 |
sudo apt-get upgrade --fix-missing |
- try to upgrade the system (sometimes an updated package version fixes the issue)
|
1 2 |
sudo apt-get upgrade sudo apt-get dist-upgrade |
- try to reconfigure all applications that failed to install
|
1 |
sudo dpkg --configure -a |
- try to reconfigure specific applications that failed to install
|
1 |
sudo dpkg --configure YOUR-APP |
- try to fix broken packages
|
1 |
sudo apt-get install -f |
- try to fix a specific broken package
|
1 |
sudo apt-get install YOUR-APP -f |
- try to install the dependencies that an application requires for it to install successfully
|
1 |
sudo apt-get build-dep YOUR-APP |
- re-try to install the failed apps
|
1 |
sudo apt-get install |
If none of the above fix it, try this:
- Go to the website that maintains the failed package. In most cases, this will be Launchpad.net (for Ubuntu flavors, go here); users of Debian distros (inc. Ubuntu) can download source code packages from Debian.org and a lot of packages for all distros are maintained through Gna. If you’re really stuck, Google it;
- Search for the failed package then re-download it and re-install it. First try the deb package that is pre-built for your OS version then, if that doesn’t work, download the source code and build it from scratch;
- Most packages ship with installation instructions written in a Readme or Installation file (it’s important to read them). Most build with either
123./configuremakemake install- else
1python setup.py install- Ensure any shared libraries are properly registered
1sudo ldconfig
If you struggle to install the downloaded source code you can read this Linux Software Installation EasyGuide. The downside to installing from source code (i.e not through Apt, Aptitude, Yum or dpkg) is that your regular package manager will not know that the software has been installed. Just re-install it through your regular package manager once it is functioning properly.
If you are still battling away after trying the above then you have no choice but to bring out your longsword and start swinging at dpkg’s bowels:
- backup your dpkg status file with
|
1 |
sudo cp /var/lib/dpkg/status status.bckup |
- just for reference, if you need to restore the backup version of the status file, type
|
1 |
sudo mv status.bckup > /var/lib/dpkg/status |
- edit your dpkg status file
- KDE Users
1kdesudo kate /var/lib/dpkg/status- Gnome users
1gksu gedit /var/lib/dpkg/status - search for the problem package(s) by name (press Ctrl+F),
- edit the line that reads
|
1 |
Status: install reinstreq half-configured |
to replace it with
|
1 |
Status: install ok installed |
and save it,
- then either uninstall the package(s) then/or re-install it(them) with either
|
1 |
sudo apt-get remove YOUR-APP |
- else
|
1 |
sudo apt-get install YOUR-APP |
- If the problem persists, re-edit /var/lib/dpkg/status but this time search for the failed package by name and delete its details from
1Package....
to
1Description....
Delete from the open line above package to the open line below its description that leads on to the next package’s details. Here is an example of the complete package listing for ‘lsb-core’:
1234567891011121314151617181920212223242526272829303132Package: lsb-coreStatus: install ok installedPriority: extraSection: miscInstalled-Size: 196Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>Architecture: amd64Source: lsbVersion: 4.0-0ubuntu5Replaces: lsb (<< 2.0-2)Provides: lsb-core-amd64, lsb-core-noarchDepends: lsb-release, libc6 (>> 2.3.5), libz1, libncurses5, libpam0g, postfix | mail-transport-agent, at, bc, binutils, bsdmainutils, bsdutils, cpio, cron, ed, file, libc6-dev | libc-dev, locales, cups-bsd | lpr, lprng | cups-client, m4, mailx | mailutils, make, man-db, mawk | gawk, ncurses-term, passwd, patch, pax, procps, psmisc, rsync, alien (>= 8.36), python, python-central (>= 0.6.11), debconf (>= 0.5) | debconf-2.0, libc6-i386, lib32z1, lsb-base, timeConflicts: lsb (<< 2.0-2)Description: Linux Standard Base 4.0 core support packageThe Linux Standard Base (http://www.linuxbase.org/) is a standardcore system that third-party applications written for Linux candepend upon..This package provides an implementation of the core of version 4.0 ofthe Linux Standard Base for Debian on the Intel x86, Intel ia64(Itanium), IBM S390, and PowerPC 32-bit architectures with the Linuxkernel. Future revisions of the specification and this package maysupport the LSB on additional architectures and kernels..The intent of this package is to provide a best current practice wayof installing and running LSB packages on Debian GNU/Linux. Itspresence does not imply that Debian fully complieswith the Linux Standard Base, and should not be construed as astatement that Debian is LSB-compliant.Homepage: http://www.linux-foundation.org/en/LSBOriginal-Maintainer: Chris Lawrence <lawrencc@debian.org>Python-Version: all
That whole section would be deleted were lsb-core an issue on your system. - When you update your package list you will notice that those packages with their details removed from dpkg’s status file will not now show as installed by dpkg. Rest assured, those packages are still installed/semi-installed but dpkg is no longer aware of them. At this point you can choose to either ‘re-install’ the badly installed package or just leave it hanging on your system as an undetected badly installed package which you should try to re-install at a later time. I recommend you try to re-install immediately. If you leave it as an undetected package, dpkg will not automatically update it and will try to re-install it should it be a dependency of other packages that you later try to install.
If none of those steps fix it then the likelihood is that nothing will but search the net before you decide to re-install your operating system.
As a word of caution, never, ever delete your dpkg (apt) status file. If someone tells you to type
|
1 |
sudo rm /var/lib/dpkg/status |
Ignore them or your computer will explode! You can open it up, look at it and edit it but you must never, ever delete it. It contains all the data dpkg requires to update and uninstall packages. If you delete it you will not be able to properly remove or upgrade the packages installed prior to it being removed and you might have problems when you try to install new packages into your system.
Bootnote: You can use Aptitude to “Hold” partially installed packages and packages that prevent others from being installed. Open a terminal, type “sudo aptitude”, press “Ctrl+T” then “Return”, use the arrow keys to navigate to the suspect package, press the “equals” key i.e “=” (the package to be held should now change color), press Ctrl+T then press return and any packages that are ready to install but were stuck due to the (now) held package will now install.
Visit the Software Installation EasyGuide for more installation error busters and the Ubuntu Repository List to get extra useful repositories for your system.



Leave a Reply
29 Comments on "Fixing the Dreaded “Errors were encountered while processing” Errors"
Thank you SO very much !!!!!!!!!!!!!!
Ditto – I spent ages trying to fix this on one of my machines. Many thanks!
Very welcome.
Welcome to Linux, Corduene. You’re welcome for the information.
I’ve used Linux for years. It can take a little bit of getting accustomed to but it is worth it. You might already know this but…. if you do need to use Windows software you can install it through Wine or PlayOnLinux; if they fail you can use VirtualBox to install Windows in a virtual computer that will run within Linux while Linux is in operation. There are a few additional repositories (with a few software installation tips) here at JournalXtra.
Thanks for dropping by and for commenting :)
great article, managed to install radio tray 0.6.3 with
sudo apt-get build-dep radiotray before installing from .dev package
you’re welcome and thank you :-)
Dude, you must have had a VEEEEEERY long day figuring out all that. Thanx for the post, I hated that bug too…
It was a fun one though and it gave me plenty to write about so I smiled at the end of it. Thanks for dropping by :-)
great post! it helped me a lot
You’re welcome
great post! it helped me a lot
You’re welcome!
I’m so glad I found this page. Today I tried to install Oracle’s Java 7 (though WebUpd8’s PPA), and found that it would neither install, nor uninstall, and caused other package upgrades/installs to fail. I had to resort to removing the troublesome section from /var/lib/dpkg/status.
Thanks so much!
Glad to have helped.
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
qmail
qmail-run
E: Sub-process /usr/bin/dpkg returned an error code (1)
[email protected]:~# sudo ldconfig
[email protected]:~# sudo dpkg -r YOUR-APP^C
[email protected]:~# sudo dpkg -r qmail
(Reading database … 142635 files and directories currently installed.)
Removing qmail …
rmdir: failed to remove `/var/lib/qmail’: Directory not empty
Processing triggers for man-db …
I AM NOT ABLE TO RMOVE QMAIL and QMAIL_RUN..PLEASE HELP.. I AM A NEWBIE.
I can definitely help: read the article; the solution is there :p
This is AWESOME!
Thanks
Thought I was going to have to reload it from scratch.
Thank you.
There should be a PayPal Donate button on this page…
Thanks. It should be more visible. There’s a link right at the bottom of the post. I’ll add a button into the sidebar.
Thanks for your help. You are one of the heroes that make free software work.
I’m trying to adopt your vanquish the bugs attitude as well. I think it will be very helpful for me.
Thanks again!
This is both helpful and fun to read… Enjoyed it very much
Awesome, I had problems with a package that I dd’d from another server which was referencing old packages and this fixed the problem for me. Many thanks.
Very welcome.
I wish you put the problem and solution descriptions on http://askubuntu.com, so I could up-vote it!
I wish you’d post the problem+solution description on askubuntu.com, so I could up-vote it
Mine doesn’t work. My problem is that apt-utils is too damaged. Whenever i install something an error shows up saying “Package is too damaged. Please reinstall it.” When I try to reinstall it it says the same thing.
What should i do?
Thank you so much !!!!!! This post is SO valuable ! Thank you