Kubuntu install stuck with unmet dependencies


I tried to install Kubuntu on an existing Ubuntu system using this command:

$ sudo apt install kubuntu-desktop

And I got this package dependency error:

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 kde-telepathy-minimal : Depends: kde-config-telepathy-accounts (>= 15.04.0) but it is not going to be installed
 unity-scope-gdrive : Depends: account-plugin-google but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

However, running sudo apt-get -f install would stop with the same dependency problem.


The key here is to realize that apt itself cannot resolve this cyclic dependency. So, to fix it we need to use a lower-level tool to explicitly take out the offending package. We can do that by using dpkg:

$ sudo dpkg --purge unity-scope-gdrive
$ sudo dpkg --purge account-plugin-google
$ sudo apt-get -f install

Tried with: Ubuntu 15.10


How to find if a package is installed in Ubuntu

In Ubuntu, you can find out if a certain package is installed or not by using the dpkg program.

For example, to find out if package Foo is installed:

$ dpkg --get-selections Foo

Wildcards can also be used. For example, to find all the installed packages whose name begins with F:

$ dpkg --get-selections F*

Tried with: Dpkg and Ubuntu 12.04.1 LTS

How to list all installed packages in Ubuntu

InΒ Ubuntu, a list of all packages that are installed can be obtained using the dpkg program: dpkg --get-selections

The --get-selections option is needlessly verbose, there is no shorter version of it and it is hard to recall.

A better option is to use: dpkg -l

This lists other details of the package along with its name, like version, architecture and description. But hey, the option is easier to recall πŸ™‚

Tried with: Dpkg 1.17.5 and Ubuntu 14.04