“无法纠正问题,您持有损坏的包裹”错误

“无法纠正问题,您持有损坏的包裹”错误

在我安装了“unity-tweak-tool”的语言包和一些简单程序(CopyQ 和类似程序)后,出现了很多问题。

关闭 unity-tweak-tool 后,我发现“unity-tweak-tool”未显示在应用程序列表中。我尝试重新安装“unity-tweak-tool”,但安装失败,并出现错误E: Unable to correct problems, you have held broken packages.

我尝试过

  • 我试图删除它

    sudo apt-get remove unity-tweak-tool 
    sudo apt purge unity-tweak-tool  
    sudo apt autoremove   
    sudo apt update 
    sudo apt -f install
    

尝试通过 aptitude 安装

    sudo aptitude install unity-tweak-tool

-

    sudo apt-get install --fix-broken
    sudo apt-get autoclean
    sudo apt-get autoremove
    sudo apt-get -f install
  • 清除上次安装。(来自:https://ubuntu-mate.community/t/cant-install-unity-tweak-tool-not-working/7090

    sudo apt purge libqgsttools-p1  qml-module-qtquick-privatewidgets  khelpcenter libkf5attica5  libqt5clucene5  libqt5svg5  qml-module-qtquick-window2 libqt5test5  qml-module-qtwebkit  libkf5i18n-data  qml-module-qtquick2 libqt5help5  qml-module-qtquick-controls  libqt5multimedia5  libkf5declarative5 qtwayland5  libqt5dbus5  python3-pyqt5  libqt5sql5-sqlite  qml-module-qtquick-xmllistmodel  qml-module-qtquick-layouts  libqt5widgets5  qml-module-qttest libqt5waylandclient5  qml-module-qtquick-dialogs  kde-style-qtcurve-qt5 qmlscene  libqt5xml5  libqt5quicktest5  libqt5printsupport5  libqt5qml5 libqt5designercomponents5  frameworkintegration  libqt5gui5  libqt5multimedia5-plugins  libqt5quickwidgets5  libqt5x11extras5  libkf5declarative-data libqt5webkit5  libqt5script5  libqt5core5a  libkf5iconthemes-data  libqt5opengl5 libqt5xmlpatterns5  libkf5iconthemes5  qttools5-dev-tools  libqt5network5 libqt5designer5  libqt5positioning5  qtdeclarative5-dev-tools  libkf5kiocore5 libqt5quick5  libqt5sql5  libkf5i18n5  libqt5sql5-mysql  
    
  • 此后,一些应用程序被损坏。(VLC、CopyQ、Glipper,...)

  • 我尝试重新安装它们,但不起作用。出现了同样的错误。例如 VLC

    sudo apt install vlc
    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:
    vlc : Depends: vlc-nox (= 2.2.2-5) but 2.2.2-5ubuntu0.16.04.4 is to be installed
     Depends: libgles1-mesa (>= 7.8.1) but it is not going to be installed or
                libgles1
       Recommends: vlc-plugin-notify (= 2.2.2-5) but it is not going to be installed
       Recommends: vlc-plugin-samba (= 2.2.2-5) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    
  • 重启系统后,“Glipper”自动启动,但它没有显示在应用程序列表中。

  • 我也尝试了“synaptic”(VLC 的结果是:)

synaptic VLC 安装错误

Synaptic VLC 安装

  • 还尝试 grep 持有的程序。但是什么也没有显示。

    dpkg --get-selections | grep hold
    

有什么解决办法吗?

答案1

我的问题已经解决。至少对于“VLC”和“unity-tweak-tool”程序而言。

但对于某些程序(如“Foxit Reader PDF”)无法修复。因为它的安装是手动的。(“福柯阅读器”在高亮显示文本或做任何评论时崩溃并关闭)。

问题是“我没有aptitude正确使用命令。”

细节如下:

首先在终端中运行它(注意:您可能需要安装“aptitude”包sudo apt-get install aptitude

sudo aptitude install vlc

过了一会儿它问:

Keep the following packages at their current version:
    1)     libgles1-mesa [Not Installed]                      
    2)     vlc [Not Installed]                                
    3)     vlc-plugin-notify [Not Installed]                  
    4)     vlc-plugin-samba [Not Installed]                   

    Accept this solution? [Y/n/q/?] n

答案是n(否)

然后它问:

Remove the following packages:                                            
    1)      libgl1-mesa-glx:i386                                                    
    2)      libglu1-mesa:i386                                                       
    3)      wine-devel                                                              
    4)      wine-devel-i386:i386                                                    
    5)      wine1.4                                                                 
    6)      wine1.4-amd64                                                           
    7)      winehq-devel                                                            

 Downgrade the following packages:                                         
    8)      libgl1-mesa-glx [17.0.7-0ubuntu0.16.04.2 (now) -> 11.2.0-1ubuntu2 (xenia
    9)      libglapi-mesa [17.0.7-0ubuntu0.16.04.2 (now) -> 11.2.0-1ubuntu2 (xenial)
    10)     libglapi-mesa:i386 [17.0.7-0ubuntu0.16.04.2 (now) -> 11.2.0-1ubuntu2 (xe
    11)     libgles2-mesa [17.0.7-0ubuntu0.16.04.2 (now) -> 11.2.0-1ubuntu2 (xenial)
    12)     libosmesa6 [17.0.7-0ubuntu0.16.04.2 (now) -> 11.2.0-1ubuntu2 (xenial)]  
    13)     libosmesa6:i386 [17.0.7-0ubuntu0.16.04.2 (now) -> 11.2.0-1ubuntu2 (xenia
    14)     libvlccore8 [2.2.2-5ubuntu0.16.04.4 (now) -> 2.2.2-5 (xenial)]          
    15)     vlc-data [2.2.2-5ubuntu0.16.04.4 (now) -> 2.2.2-5 (xenial)]             


    Accept this solution? [Y/n/q/?] y

回答是y(是)

然后问:

The following packages will be DOWNGRADED:
  libgl1-mesa-glx libglapi-mesa libglapi-mesa:i386 libgles2-mesa libosmesa6 
  libosmesa6:i386 libvlccore8 vlc-data 
The following NEW packages will be installed:
  libgles1-mesa{a} libqt5x11extras5{a} vlc vlc-nox{a} vlc-plugin-notify{a} 
  vlc-plugin-samba{a} 
The following packages will be REMOVED:
  libgl1-mesa-glx:i386{a} libglu1-mesa:i386{a} wine-devel{a} 
  wine-devel-i386:i386{a} wine1.4{a} wine1.4-amd64{a} winehq-devel{a} 
0 packages upgraded, 6 newly installed, 8 downgraded, 7 to remove and 42     not upgraded.
Need to get 6,395 kB/12.8 MB of archives. After unpacking 168 MB will be freed.
Do you want to continue? [Y/n/?] y

再回答y一下。

此后,问题得到解决并且 VLC 已正确安装。

我希望这对其他人也有帮助。

感谢您的关注

答案2

我遇到过类似的情况。我按照以下方式解决了。

我记下了所有“依赖”包,并输入 apt-get install 来安装它们。但当我输入更多“依赖”包时,它又出现了错误。我也记下了它们,并再次输入 apt-get install 来安装它们,依此类推,直到我安装到最后一个包。然后我输入 apt-get remove 来删除我之前记下的所有“依赖”包。之后我运行 apt-get autoremove。然后我就可以安装我需要的包,而不会出现错误。

相关内容