1

After running the following four commands my system ended up in broken packages state:

1) apt-get purge nvidia*
2) apt-get autoremove
3) apt-get dist-upgrade
4) apt-get autoremove

I found that unity tweak tool, ubuntu desktop and some essential packages have been removed from the system in the process. Here is the detailed history of above four commands: http://pastebin.com/PsNNAJ5t I tried reinstalling all the removed packages from the history from step4 above. It was successful. But the packages removed from step3 are not installing.

And synaptic package manager doesn't let me install anything complaining about broken packages. I have tried fixing by running sudo apt-get install -f sudo dpkg --configure -a but it did not work

~ $ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libbonoboui2-0 libbonoboui2-common libglade2-0 libgnome2-0 libgnome2-bin libgnomecanvas2-0 libgnomecanvas2-common libgnomeui-0 libgnomeui-common libidl-2-0 liborbit2 python-gconf
  python-gnome2 python-pyorbit
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

When I try to install unity-tweak-tool, it gives me that broken state message and what dependencies it require

sudo apt-get install unity-tweak-tool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 unity-tweak-tool : Depends: unity-webapps-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When I try to install it's dependencies, it continues like a chain complaining about broken packages. At the end of the chain, the dependency doesn't install.

This is the end result if I follow a dependency chain: http://pastebin.com/m01QX442 In the end of the chain, it says E: Package 'qtbase-abi-5-5-1' has no installation candidate or E: Package 'qtdeclarative-abi-5-5-0' has no installation candidate I also don't understand how my system is operational without ubuntu-desktop How to fix the system now?

Thanks

  • Take a look at this question, I'm assuming your working with Ubuntu 16.04. – yorodm Dec 20 '16 at 15:51
  • I saw it already. The solution there is not working. it gives me that broken state message and what dependencies it require. When I try to install the dependencies, it continues like a chain complaining about broken packages. At the end of the chain, the dependency doesn't install –  Dec 20 '16 at 16:00
  • At the end of the chain, the dependency doesn't install Can you be more specific? Does it give an error? – Nattgew Dec 20 '16 at 16:10
  • This is the end result if I follow a dependency chain:

    http://pastebin.com/m01QX442

    In the end of the chain, it says

    E: Package 'qtbase-abi-5-5-1' has no installation candidate

    or

    E: Package 'qtdeclarative-abi-5-5-0' has no installation candidate

    I did not follow through all branches of the chain. Should I do it?

    –  Dec 20 '16 at 16:41

2 Answers2

0

For whatever reason dpkg --configure -a was essentially removed from Ubuntu a few releases ago (since 16.04 I believe) so it no longer works and will tell you that -a is an invalid target.

You say "did not work" but this doesn't provide much detail about how apt-get install -f failed, but I can make some assumptions. It probably spits out a name of a package that is in the broken state and what dependencies it requires.

After getting the name of the package that is broken and it's dependencies you can try apt-get remove either the package itself or the dependency. If it's a package you don't care about just remove it, otherwise try removing the dependency and seeing what would go along with that. It's usually caused by some tool wanting to keep a specific version of a library or program. Also take note if some "packages are held back" as this can also keep you from being to resolve dependencies.

Run apt-get install -f and it will continue this process until there are no packages in a broken state.

  • This is the output ~ $ sudo apt-get install -f [sudo] password for code_brah: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libbonoboui2-0 libbonoboui2-common libglade2-0 libgnome2-0 libgnome2-bin libgnomecanvas2-0 libgnomecanvas2-common libgnomeui-0 libgnomeui-common libidl-2-0 liborbit2 python-gconf python-gnome2 python-pyorbit Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded. –  Dec 20 '16 at 15:21
  • When I try to install unity-tweak-tool, it gives me that broken state message and what dependencies it require. The following packages have unmet dependencies: unity-tweak-tool : Depends: unity-webapps-common but it is not going to be installed E: Unable to correct problems, you have held broken packages. When I try to install the dependencies, it continues like a chain complaining about broken packages. At the end of the chain, the dependency doesn't install. –  Dec 20 '16 at 15:33
  • Just checked on my 16.04.1 system --configure -a is still present, so if it really got removed it only was 16.10 and onward and this yet has to be confirmed for me to believe it. – Videonauth Dec 20 '16 at 15:53
  • I can confirm it's removed on 16.10 I just wasn't sure if it was changed in 16.04 or not. – Kristopher Ives Dec 20 '16 at 16:47
  • 1
    Also, please don't do dist-upgrade after purging a major package. It will always remove some essential packages. – Arijit Chatterjee Dec 20 '16 at 16:52
0

I have fixed it by doing the following in the following order:

sudo ppa-purge ppa:kubuntu-ppa/backports
sudo apt-get install -f
sudo apt autoremove
sudo apt-get install unity-tweak-tool

When I did ppa-purge, this was the result:

The following package was automatically installed and is no longer required:
  libxcb-xinerama0
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  packagekit-backend-aptcc python3-packagekit
Suggested packages:
  libqt4-declarative-folderlistmodel libqt4-declarative-gestures
  libqt4-declarative-particles libqt4-declarative-shaders qt4-qmlviewer
  libqt4-dev libqt5libqgtk2 qt4-qtconfig packagekit-backend-smart
Recommended packages:
  packagekit
The following packages will be REMOVED:
  libpackagekit-glib2-18
The following NEW packages will be installed:
  packagekit-backend-aptcc python3-packagekit
The following packages will be DOWNGRADED:
  aptdaemon aptdaemon-data breeze-icon-theme gir1.2-packagekitglib-1.0
  libqt4-dbus libqt4-declarative libqt4-network libqt4-script libqt4-sql
  libqt4-sql-sqlite libqt4-xml libqt4-xmlpatterns libqt5core5a libqt5dbus5
  libqt5gui5 libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5qml5
  libqt5quick5 libqt5sql5 libqt5sql5-mysql libqt5sql5-sqlite libqt5svg5
  libqt5waylandclient5 libqt5webkit5 libqt5widgets5 libqt5x11extras5
  libqt5xml5 libqtcore4 libqtdbus4 libqtgui4 packagekit packagekit-tools
  python-aptdaemon python-aptdaemon.gtk3widgets python3-aptdaemon
  python3-aptdaemon.gtk3widgets qdbus qtchooser qtcore4-l10n
  qttranslations5-l10n qtwayland5
0 upgraded, 2 newly installed, 43 downgraded, 1 to remove and 0 not upgraded.
Need to get 34.1 MB of archives.
After this operation, 28.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

And installing unity tweak tool resulted in this:

sudo apt-get install unity-tweak-tool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libandroid-properties1 libhardware2 libhud2 libhybris libhybris-common1 libmedia1 liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 libqt5feedback5 libqt5multimedia5 libqt5organizer5
  libqt5positioning5 libqt5quicktest5 libqt5test5 libubuntugestures5 libubuntutoolkit5 libunity-action-qt1 libunity-webapps0 qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings
  qml-module-qtfeedback qml-module-qtgraphicaleffects qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2 qml-module-qttest qml-module-ubuntu-components
  qml-module-ubuntu-layouts qml-module-ubuntu-onlineaccounts qml-module-ubuntu-performancemetrics qml-module-ubuntu-test qml-module-ubuntu-web qtdeclarative5-accounts-plugin
  qtdeclarative5-qtquick2-plugin qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-unity-action-plugin suru-icon-theme ubuntu-mobile-icons ubuntu-ui-toolkit-theme unity-webapps-common
  unity-webapps-qml unity-webapps-service webapp-container webbrowser-app
Suggested packages:
  xul-ext-unity | unity-chromium-extension qtdeclarative5-online-accounts-client0.1 qtdeclarative5-ubuntu-content1 qtdeclarative5-ubuntu-download-manager0.1
  qml-module-ubuntu-onlineaccounts-client
The following NEW packages will be installed:
  libandroid-properties1 libhardware2 libhud2 libhybris libhybris-common1 libmedia1 liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 libqt5feedback5 libqt5multimedia5 libqt5organizer5
  libqt5positioning5 libqt5quicktest5 libqt5test5 libubuntugestures5 libubuntutoolkit5 libunity-action-qt1 libunity-webapps0 qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings
  qml-module-qtfeedback qml-module-qtgraphicaleffects qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2 qml-module-qttest qml-module-ubuntu-components
  qml-module-ubuntu-layouts qml-module-ubuntu-onlineaccounts qml-module-ubuntu-performancemetrics qml-module-ubuntu-test qml-module-ubuntu-web qtdeclarative5-accounts-plugin
  qtdeclarative5-qtquick2-plugin qtdeclarative5-ubuntu-ui-toolkit-plugin qtdeclarative5-unity-action-plugin suru-icon-theme ubuntu-mobile-icons ubuntu-ui-toolkit-theme unity-tweak-tool
  unity-webapps-common unity-webapps-qml unity-webapps-service webapp-container webbrowser-app
0 upgraded, 46 newly installed, 0 to remove and 0 not upgraded.
Need to get 45.1 MB of archives.
After this operation, 166 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

I got this idea after looking at the answer here

I think the reason was that when I did the upgrade it has upgraded some of the dependencies required by other packages using Kubuntu ppa. But the downgraded versions were required for the packages to work correctly. I do not know which package was it exactly.

  • 1
    This is why using PPAs is often dangerous (especially for big software stacks like KDE or GNOME). Perhaps just stick with the Ubuntu interim releases? Use Snappy, Flatpak and/or AppImage where possible if you want to update software past their official Ubuntu versions. – Ads20000 Dec 22 '16 at 12:56