How do I locate and remove Broken Packages that I have installed?

  • Install the Synaptic Package Manager, either through the Software Center or by running this command in the Terminal:

     sudo apt-get install synaptic 
    
  • Open it by typing synaptic in the Unity dash and then hitting Enter.

  • Then follow this procedure:

    1. Select the "Status" category. This shows packages organized by status.
    2. Select "Broken dependencies" category from upper left pane.
    3. Select the broken packages. If the packages are more than one, select them all by pressing Ctrl+A.
    4. Then right-click on a selected package, and select the option "Mark for Complete Removal" in the menu.

    Screenshot showing "Mark for complete removal" on packages with broken dependencies

That's it. The broken packages are gone.


Synaptic Package Manager (available in the Software Center) is a graphical tool for managing packages, and among many features it allows you to filter packages by their state. In few clicks, by selecting the desired category on the left panel, you will be presented with the list of packages that require fixing.


No downloads, no GUI needed:

You can list broken packages :

dpkg -l | grep ^..r 

r state (on the third field) means: reinst-required (package broken, reinstallation required)

dpkg fields explanation

To list and remove these packages:

dpkg -l | grep ^..r | while read -r | tr -s ' ' | cut -d' ' -f2 | while read -r name; do sudo apt-get remove "$name"; done

(Answer copied from this thread.)