Fixing the Dreaded “Errors were encountered while processing” Errors

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 Perils of Tux

The Perils of Tux!

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:

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:

    1. ensure that the shared libraries are properly registered (also fixes some GCC/G++ errors)

    1. try to remove the package (replace ‘your-app’ with the name of the dodgy application)

    1. check your package cache

    1. update your package list

    1. ensure package downloads were properly completed when the system last updated

    1. try to upgrade the system (sometimes an updated package version fixes the issue)

    1. try to reconfigure all applications that failed to install

    1. try to reconfigure specific applications that failed to install

    1. try to fix broken packages

    1. try to fix a specific broken package

    1. try to install the dependencies that an application requires for it to install successfully

    1. re-try to install the failed apps

If none of the above fix it, try this:

  1. 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;
  2. 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;
      1. Most packages ship with installation instructions written in a Readme or Installation file (it’s important to read them). Most build with either

      1. else

      1. Ensure any shared libraries are properly registered

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:

    1. backup your dpkg status file with

    1. just for reference, if you need to restore the backup version of the status file, type

    1. edit your dpkg status file
        1. KDE Users

        1. Gnome users

    2. search for the problem package(s) by name (press Ctrl+F),
    3. edit the line that reads

to replace it with

and save it,

    1. then either uninstall the package(s) then/or re-install it(them) with either

    1. else

  1. 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

    to

    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’:

    That whole section would be deleted were lsb-core an issue on your system.
  2. 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

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.

Comments

  1. Corduene says

    Thank you very much! My issue was ‘Errors were encountered while processing:gnomeradio’, and being a newbie, I had no idea how to deal with it. The solution was “8. 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…” as you stated in your explanation above. I removed all the info lines on ‘gnomeradio’ from Product: gnomeradio to the final line of the description and saved it. I went back to Ubuntu Software Centre and downloaded FM-Radio Tuner and it installed without an issue :). I think it was caused when my power to my pc was interrupted as it was installing the application. Once again, thanks a lot for this information!

    • says

      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 :)

  2. Tertre says

    great article, managed to install radio tray 0.6.3 with
    sudo apt-get build-dep radiotray before installing from .dev package

  3. Thermostatix says

    Dude, you must have had a VEEEEEERY long day figuring out all that. Thanx for the post, I hated that bug too…

  4. Shane Gelling says

    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!

  5. Abhisishek Dokania says

    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)
    root@abhishek-Studio-1458:~# sudo ldconfig
    root@abhishek-Studio-1458:~# sudo dpkg -r YOUR-APP^C
    root@abhishek-Studio-1458:~# 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.

  6. Kevin says

    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!

  7. says

    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.

Leave a Reply