如何在这种特定情况下修复损坏的包?

运行以下四个命令后,我的系统最终处于损坏的包状态:

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

我发现统一调整工具,ubuntu桌面和一些必要的软件包已经从系统中删除了。 以下是上述四个命令的详细历史记录: http : //pastebin.com/PsNNAJ5t我尝试从上面的步骤4重新安装历史记录中的所有已删除的软件包。 它很成功。 但是从步骤3中删除的包不会安装。

并且synaptic包管理器不允许我安装任何抱怨破坏包的东西。 我试过通过运行sudo apt-get install -f sudo dpkg --configure -a修复但是它没有用

 ~ $ 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. 

当我尝试安装unity-tweak-tool时,它会向我提供破坏状态消息以及它需要哪些依赖项

 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. 

当我尝试安装它的依赖项时,它会继续像一个抱怨破坏包的链。 在链的末尾,依赖项不会安装。

如果我遵循依赖关系链,这是最终结果: http E: Package 'qtbase-abi-5-5-1' has no installation candidate在链的末尾,它说E: Package 'qtbase-abi-5-5-1' has no installation candidateE: Package 'qtdeclarative-abi-5-5-0' has no installation candidate我也不明白我的系统如何在没有ubuntu-desktop情况下运行如何立即修复系统?

谢谢

无论出于何种原因, dpkg --configure -a在几个版本之前基本上从Ubuntu中删除了(自16.04以来我相信)所以它不再起作用并告诉你-a是无效的目标。

你说“没有用”但这并没有提供关于apt-get install -f如何失败的详细信息,但我可以做一些假设。 它可能会吐出一个处于破坏状态的包的名称以及它需要的依赖项。

获取破坏的软件包的名称及其依赖项后,您可以尝试使用apt-get remove软件包本身或依赖项。 如果它是一个你不关心的包只是删除它,否则尝试删除依赖项,看看会发生什么。 这通常是由某些工具想要保留特定版本的库或程序引起的。 还要注意一些“包被阻止”,因为这也可以防止您解决依赖关系。

运行apt-get install -f ,它将继续此过程,直到没有处于损坏状态的软件包。

我已按以下顺序执行以下操作来修复它:

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

当我做ppa-purge时,这就是结果:

 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 

并安装Unity调整工具导致:

 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] 

看完这里的答案后,我明白了这个主意

我认为原因是当我进行升级时,它已使用Kubuntu ppa升级了其他软件包所需的一些依赖项。 但是降级版本是包正常工作所必需的。 我不知道它究竟是哪个包。