Ubuntu – apt-get and aptitude seem to disagree — do I really have broken packages

aptaptitudedpkgpackage-management

If I do aptitude search ~b I get a list of 78 broken packages. But 76 of them aren't even installed (they have a status of pB). How can an uninstalled package be considered broken??

But if I do apt-get -s install -f it says there is nothing to do, so apparently apt-get doesn't think anything is broken.

And given that aptitude thinks a package is broken, how do I figure out why it thinks the package is broken?

Some output:

# aptitude search "~i ~b"
iB  foomatic-db-compressed-ppds                                    - OpenPrinting printer support - Compressed PPDs derived from the database
iB  xz-lzma                                                        - XZ-format compression utilities - compatibility commands

Those really are the only two. But if I do just ~b then I get a bunch of uninstalled broken (whatever that means) packages. Here are the first few (of 76):

# aptitude search ~b
pB  bison                           - YACC-compatible parser generator
pB  compiz-fusion-plugins-extra     - transitional dummy package.
pB  compiz-fusion-plugins-main      - transitional dummy package.
pB  cpu-checker                     - tools to help evaluate certain CPU (or BIO

As for dpkg,

# dpkg-query -l xz-lzma
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version                       Description
+++-=============================-=============================-==========================================================================
ii  xz-lzma                       5.1.1alpha+20110809-3         XZ-format compression utilities - compatibility commands

So what's going on? And how do I fix it (if there's even anything actually broken)?

Best Answer

There is probably nothing really wrong.

Simple answer: apt-get and aptitude have different dependency resolvers (how-do-i-fix-these-broken-dependencies).

To see if there is actually an issue you can run the following commands:

sudo apt-get update
sudo apt-get install --reinstall foomatic-db-compressed-ppds xz-lzma

Personally, I would advise against using aptitude as it can sometimes be dangerous.

apt-get is much safer and will not install with broken packages in place, however, apt-get is rarely, if ever, able to to fix an impossible situation because of broken packages. aptitude does have ability to fix broken packages but aptitude also has the ability to create a situation where broken packages exist.

A happy medium is synaptic. synaptic has more ability to fix broken packages than apt-get but does not have quite the ability of aptitude to create such a situation.

Sources: how-do-i-fix-these-broken-dependencies