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

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

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

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

我发现在此过程中,unity tweak tool、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://pastebin.com/m01QX442在链的最后,它说E: Package 'qtbase-abi-5-5-1' has no installation candidate或者E: Package 'qtdeclarative-abi-5-5-0' has no installation candidate 我也不明白我的系统如何在没有ubuntu-desktop 如何修复系统的情况下运行?

谢谢

答案1

无论出于什么原因,dpkg --configure -a它在几个版本之前就从 Ubuntu 中删除了(我相信从 16.04 开始),所以它不再起作用并且会告诉您这-a是一个无效的目标。

您说“没有工作”,但这并没有提供太多有关apt-get install -f失败细节的信息,但我可以做出一些假设。它可能会给出处于损坏状态的包的名称以及它需要哪些依赖项。

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

运行apt-get install -f后它将继续这个过程,直到没有包处于损坏状态。

答案2

我已按照以下顺序执行以下操作来修复此问题:

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 tweak 工具后得到如下结果:

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 升级了其他软件包所需的一些依赖项。但降级的版本是软件包正常工作所必需的。我不知道具体是哪个包。

相关内容