Ubuntu – ‘E: Unresolved dependencies.’ when trying to install new packages

10.04aptinstallationpackage-management

I have installed Lazarus IDE downloaded from the website, not from Ubuntu Software Manager. I couldn't install it from USC so I downloaded it. But after I installed it using

sudo dpkg -i *.deb

(which I run in downloaded folder) I cannot install or uninstall anything else. For example when I try to install SciDavis I get:

misery@VaultDweller:~$ sudo apt-get install scidavis
Reading packages list... Ready
Building dependencies tree    
Reading information about the status... Ready
It is recoomended to run "apt-get -f install", to repair them:
Following packages have dependency issues:
  lazarus-ide-0.9.30.2: requires: libgdk-pixbuf2.0-0 (>= 2.22.0) but it cannot be installed
                        requires: libgtk2.0-0 (>= 2.24.0) ale 2.20.1-0ubuntu2.1 is to be installed
  lazarus-ide-gtk2-0.9.30.2: requires: libgdk-pixbuf2.0-0 (>= 2.22.0) but it cannot be installed
                             requires: libgtk2.0-0 (>= 2.24.0) ale 2.20.1-0ubuntu2.1 is to be installed
  lcl-qt4-0.9.30.2: requires: libqt4pas-dev but it cannot be installed
  scidavis: requires: libmuparser0 but will not be installed
            requires: libqt4-qt3support (>= 4:4.5.3) but will not be installed
            requires: libqwt5-qt4 but will not be installed
            requires: libqwtplot3d-qt4-0 but will not be installed
E: Unresolved dependencies. Please try "apt-get -f install" without packages (or provide solution).

Lazarus works fine, as every other previously installed app. If I use recommended

apt-get -f install

it removes Lazarus packages and Lazarus works no more, but USC and apt-get work well.

How to repair that?

Best Answer

This means that the Lazarus packages have dependencies that cannot be satisfied in your version of Ubuntu. Thus apt-get decides that it's best to remove it than to leave it in a broken state.

For instance, Lazarus wants libgdk-pixbuf-2.0-0, which is not available in your version of Ubuntu (Lucid). Also, the version of libgtk2.0-0 it needs (2.24.0 or greater) is only available from Ubuntu 11.04 onwards.

What this indicates is that the Lazarus package was created in a newer version of Ubuntu.

Now, you say it works, so it's apparently not entirely incompatible with the libraries you have installed. So it's a problem with the software's packaging, rather than with the binaries themselves. If it works with older versions of, say, libgtk, the package should not require a newer version. This would have to be fixed by the Lazarus people.

There are two ways to fix the packaging problem:

  1. Try to find a version of the Lazarus package for Ubuntu 10.04 (may be outdated and lack features you need).

  2. Upgrade your Ubuntu to a newer release, it's very likely that Lazarus will install without conflicts there.