68
$ apt-get install -f -o 'Dpkg::Options::=--force-confmiss --force-all --force-confnew --overwrite-conffiles' --reinstall at-spi2-core
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 kde-workspace-bin : Depends: qdbus but it is not going to be installed
 libqt4-dbus : Depends: qdbus (= 4:4.8.5+git192-g085f851+dfsg-2ubuntu4) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I don't quite understand "but it is not going to be installed". Why doesn't it install it then?

apt-get -f install does not help, it does nothing:

$ apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6
  • You could try to find out why qdbus is not being installed by installing it yourself: sudo apt-get install qdbus.
    – Jos
    Commented Dec 22, 2014 at 11:15
  • 7
    @Jos: I did that. Now it works. However, that doesn't really answer my question or what the problem was.
    – Albert
    Commented Dec 22, 2014 at 11:15
  • I suppose it was the combination of options in your original apt-get command that prevented apt from installing additional dependencies.
    – Jos
    Commented Dec 22, 2014 at 11:20
  • Here it was that I missed main and only had deb http://de.archive.ubuntu.com/ubuntu/ wily universe multiverse in addition to trusty. Then, apt wanted to install a package from universe, which depended on versions available in wily/main only and thus could not be installed.
    – koppor
    Commented Jan 23, 2016 at 14:45
  • 1
    Try adding the missing package to the install command: sudo apt-get install --reinstall at-spi2-core qdbus libqt4-dbus
    – antivirtel
    Commented Apr 2, 2016 at 20:58

10 Answers 10

39

This worked for me.

$ sudo apt-get install <missing-package-1> <missing-package-2> ...

I don't know why this is necessary, but manually installing the problematic packages worked.

After installing the first round of unmet dependencies, another one popped up, but I repeated the process and it sorted itself out after two cycles.

4
  • 24
    Wow, it really is this simple... It makes me wonder why it wouldn't install in the first place?
    – Jacksonkr
    Commented Apr 19, 2016 at 3:47
  • This helped me too, but had to run twice second time with reverse order of package names. Not sure if reversing order was necessary.
    – PeterM
    Commented Apr 22, 2018 at 16:17
  • Does not work every time. Older packages that were removed will never install this way. Example Depends: iptables-dev but it is not installable.
    – Dave
    Commented Aug 15, 2022 at 15:18
  • as the error says, the package is not installable, so it does not help...
    – Liker777
    Commented Jan 24, 2023 at 20:01
22

As this question also didn't help, I found on this LinuxQuestions thread a hint that helped me:

Do you have a mixed /etc/apt/sources.list? It appears that you're trying to install one package from a newer repository but that it doesn't have access to a repository with the newer dependencies.

3
  • A mixed sources file, or maybe one with only a single repository but that has missing packages
    – golimar
    Commented Mar 14, 2018 at 13:22
  • I had the same problem - my sources.list had only the main repository and the dependency was somewhere else (universe, restricted, ...). The error message is very misleading.
    – WoJ
    Commented Sep 20, 2018 at 9:00
  • 1
    Yes, this is a possible reason. For example, ubuntu 20.04 with ubuntu 16.04 (xenial)'s sources.list, would make apt install xxx report similar problem.
    – HaxtraZ
    Commented Nov 11, 2020 at 10:49
11

I ran into this issue and solved it by running:

sudo apt-get update
sudo apt-get upgrade

Then when I ran the original "apt-get install" command succeeded.

4

Nothing above worked for me but following procedure saved me

sudo dpkg --configure -a 

this will list the broken packages and

sudo dpkg -r librrd4 

{librrd4 and libpng12 were my broken pakages solved the problem

1
  • Thank god. dpkg -r saved me. Stupid apt Commented Mar 18, 2022 at 18:20
1

I also had the same issue while installing Guake; it showed unmet dependencies with Python. Even trying to reinstall python using sudo apt-get install --reinstall python did nothing.

Finally,

Step-1: I had to remove and install python again using:

Note: Uninstalling python leads to removing many other dependencies which may break the installed Ubuntu, so be careful while uninstalling python

sudo apt-get purge python

sudo apt-get install python

Step-2: Install the original package (in my case it was guake)

sudo apt-get install guake

This installed all necessary dependencies.

Try the same procedure w/ your packages and it should work for you too.

2
  • 5
    Removing Python, even only temporarily, is a bad idea as it will likely remove lots of depending packages with it and it is needed to run many important system commands.
    – Byte Commander
    Commented Sep 14, 2017 at 20:03
  • I was aware of this possibility but i wasn't able to solve my issue otherwise....searched a lot but could not find a working way....as of now my ubuntu has not broken ..... waiting for it in future ;) ...
    – imflash217
    Commented Sep 14, 2017 at 20:48
1

I had a similar issue while trying to install another package. Using aptitude instead of apt-get helped solve the issue for me. Refer this answer: https://askubuntu.com/a/1379008/413845

1
  • In my case there was some impossible package situation, and aptitude provided an update plan to get around the problem. Definitely try this solution if you encounter this issue, otherwise you'll have to figure out the solution manually, as evidenced by the myriad of answers to this question
    – Ryan Lynch
    Commented Jul 18, 2023 at 23:52
0

I had similar problems with cups-filters on raspberrypi caused by realvnc-vnc-server. It was due to foomatic-filters being deprecated. I couldn't install or uninstall anything so what worked for me was to delete the apt cache for cups-filters.

sudo rm /var/cache/apt/archives/cups-filters*

Then the install worked as suggested by @funroll

sudo apt install cups cup-filters

0

In my case it needed the version of the package from focal, but it wanted to install the version from focal-updates. On theory it can be fixed by running apt-install pkg_name_here=older_specific_version_here. In my specific case that wasn't acceptable because i had many packages depending on the newer version of one of the nested dependencies which it wanted to remove along the downgrade, so i said no.

0

Get your broken/missing dependencies using

sudo dpkg --configure -a 

Once you have it, try installing them manually.

0

In addition to the other answers, remember to run sudo apt update before running things like apt-get install -f or sudo apt --fix-missing install, otherwise you might get an error because apt cannot find the newest packages which are required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .