删除 oibaf 和 paulo dias 存储库时出现依赖问题

删除 oibaf 和 paulo dias 存储库时出现依赖问题

我添加了 Oibaf 和 Paulo Diases 存储库并升级了我的系统,结果导致 apt 损坏。我无法使用 ppa 清除其中任何一个。

每当我尝试使用任何 apt 命令时都会发生这种情况。apt --fix-broken install不起作用:

sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
 libgl1-mesa-glx : Depends: libglapi-mesa (= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
                   Breaks: libgl1-mesa-glx:i386 (!= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
 libgl1-mesa-glx:i386 : Breaks: libgl1-mesa-glx (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

输出ppa-purge

sudo ppa-purge ppa:paulo-miguel-dias/mesa
Updating packages lists
PPA to be removed: paulo-miguel-dias mesa
Package revert list generated:
 libgl1-mesa-glx:amd64/zesty mesa-vdpau-drivers:amd64/zesty 
mesa-vdpau-drivers:i386/zesty

Disabling paulo-miguel-dias PPA from 
/etc/apt/sources.list.d/paulo-miguel-dias-ubuntu-mesa-zesty.list
Updating packages lists
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [amd64]) for 'libgl1-mesa-glx'
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [amd64]) for 'libglapi-mesa' because of 'libgl1-mesa-glx'
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [amd64]) for 'mesa-vdpau-drivers'
Selected version '17.2~git1704230730.070072~gd~z' (Updated and Optimized Open Graphics Drivers:17.04/zesty [i386]) for 'mesa-vdpau-drivers:i386'
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704230730.070072~gd~z is to be installed
 libgl1-mesa-glx : Depends: libglapi-mesa (= 17.2~git1704230730.070072~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
                   Breaks: libgl1-mesa-glx:i386 (!= 17.2~git1704230730.070072~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libgl1-mesa-glx:i386 : Breaks: libgl1-mesa-glx (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704230730.070072~gd~z is to be installed
 mesa-vdpau-drivers : Depends: libomxil-bellagio0 but it is not going to be installed
 mesa-vdpau-drivers:i386 : Depends: libomxil-bellagio0:i386 but it is not going to be installed
                           Depends: libxv1:i386 but it is not going to be installed
                           Depends: libxvmc1:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)

当尝试手动解决问题时,依赖地狱似乎并没有结束:

sudo apt-get install libgl1-mesa-glx=17.0.3-1ubuntu1 libgl1-mesa-dev=17.0.3-1ubuntu1 libgl1-mesa-glx:i386=17.0.3-1ubuntu1 libglapi-mesa=17.0.3-1ubuntu1Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: mesa-common-dev (= 17.0.3-1ubuntu1) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libgl1-mesa-glx:i386 : Depends: libglapi-mesa:i386 (= 17.0.3-1ubuntu1) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libglapi-mesa : Breaks: libglapi-mesa:i386 (!= 17.0.3-1ubuntu1) but 1:17.2~git170422012800.d682f8a~z~padoka0 is to be installed
 libglapi-mesa:i386 : Breaks: libglapi-mesa (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.0.3-1ubuntu1 is to be installed
 libgles2-mesa : Depends: libglapi-mesa (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.0.3-1ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

输出cat /etc/apt/sources.list

# deb cdrom:[budgie-remix 16.10 _Budgie-remix_ -  amd64 (20161013)]/ xenial main restricted

# deb cdrom:[budgie-remix 16.10 _Budgie-remix_ -  amd64 (20161013)]/ yakkety contrib main non-free

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty main restricted
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-updates main restricted
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty universe
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety universe
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-updates universe
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty multiverse
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety multiverse
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-updates multiverse
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://hr.archive.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse
# deb-src http://hr.archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu yakkety partner
# deb-src http://archive.canonical.com/ubuntu yakkety partner

deb http://security.ubuntu.com/ubuntu zesty-security main restricted
# deb-src http://security.ubuntu.com/ubuntu yakkety-security main restricted
deb http://security.ubuntu.com/ubuntu zesty-security universe
# deb-src http://security.ubuntu.com/ubuntu yakkety-security universe
deb http://security.ubuntu.com/ubuntu zesty-security multiverse
# deb-src http://security.ubuntu.com/ubuntu yakkety-security multiverse

输出sudo apt --fix-broken install

    Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
 libgl1-mesa-glx : Depends: libglapi-mesa (= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
                   Breaks: libgl1-mesa-glx:i386 (!= 17.2~git1704220730.d682f8~gd~z) but 1:17.2~git170422012800.d682f8a~z~padoka0 is installed
 libgl1-mesa-glx:i386 : Breaks: libgl1-mesa-glx (!= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

输出sudo dpkg --configure -a

dpkg: dependency problems prevent configuration of libgl1-mesa-dev:amd64:
 libgl1-mesa-dev:amd64 depends on libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0); however:
  Version of libgl1-mesa-glx:amd64 on system is 17.2~git1704220730.d682f8~gd~z.

dpkg: error processing package libgl1-mesa-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: error processing package libgl1-mesa-glx:i386 (--configure):
 package libgl1-mesa-glx:i386 1:17.2~git170422012800.d682f8a~z~padoka0 cannot be configured because libgl1-mesa-glx:amd64 is at a different version (17.2~git1704220730.d682f8~gd~z)
Errors were encountered while processing:
 libgl1-mesa-dev:amd64
 libgl1-mesa-glx:i386

/etc/apt/sources.list.d/:

# deb http://ppa.launchpad.net/budgie-remix/ppa/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
deb http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
# deb-src http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
# deb http://ppa.launchpad.net/budgie-remix/ppa/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/budgie-remix/ppa/ubuntu yakkety main
deb http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
# deb-src http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
deb http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
# deb-src http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu zesty main
deb http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
# deb-src http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
deb http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
# deb-src http://ppa.launchpad.net/morphis/anbox-support/ubuntu zesty main
deb http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
# deb-src http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
deb http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
# deb-src http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu zesty main
# deb http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
deb http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
# deb http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main # disabled on upgrade to zesty
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu yakkety main
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main
# deb-src http://ppa.launchpad.net/oranchelo/oranchelo-icon-theme/ubuntu zesty main
# deb http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
# deb-src http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
# deb http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
# deb-src http://ppa.launchpad.net/paulo-miguel-dias/mesa/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main
# deb-src http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu zesty main

答案1

几周前,我在使用 oibaf ppa 时也遇到了类似的问题。即使ppa-purge失败了,你也可以恢复到官方的 Ubuntu repo 版本。特别是因为这些包的依赖关系并不大。

因此,我建议只记下显示的输出中的软件包名称,然后使用apt policy package-name命令列出相应存储库中的版本。例如,apt policy libgl1-mesa-dev可能会像这样返回

apt policy libgl1-mesa-dev 
libgl1-mesa-dev: 
Installed: 1:17.2~git170422012800.d682f8a~z~padoka0 
Candidate: 1:17.2~git170422012800.d682f8a~z~padoka0 
Version table: 
*** 1:17.2~git170422012800.d682f8a~z~padoka0 100 
100 /var/lib/dpkg/status 
17.2~git1704230730.070072~gd~z 500 
500 ppa.launchpad.net/oibaf/… zesty/main amd64 Packages 
17.0.3-1ubuntu1 500 
500 hr.archive.ubuntu.com/ubuntu zesty/main amd64 Packages

您可以看到来自官方存储库的最新版本是17.0.3-1ubuntu1。记下此版本。对所有有问题的软件包执行此操作。

收集了所有软件包名称和官方最新版本后,您可以对所有软件包使用此类命令sudo apt install libgl1-mesa-dev=version。它将强制apt安装您提到的版本的软件包。

对于更多包来说,似乎说的是同样的事情,也包括那些包。

之后,如果运气好的话,你应该会进入最后一个官方存储库。然后使用ppa-purge优雅地清除这两个 ppa。


我们已经在聊天中讨论了这个问题并且看起来这个命令有效。

sudo apt-get install libgl1-mesa-glx=17.0.3-1ubuntu1 libgl1-mesa-dev=17.0.3-1ubuntu1 libgl1-mesa-glx:i386=17.0.3-1ubuntu1 libglapi-mesa=17.0.3-1ubuntu1 mesa-common-dev=17.0* libglapi-mesa:i386=17.0* libglapi-mesa=17.0* libglapi-mesa=17.0* libgles2-mesa=17.0*

建议我建议始终安装aptitude。如果安装了,ppa-purge可能会工作得更合适。

谢谢在我加入聊天室之前,Ravexina 就试图提供帮助。因此,特别感谢他提供了各种其他技巧。


最近发现的另一个技巧

我最近发现了一种更方便的方法来降级/摆脱依赖地狱,而无需指定版本。我列出了步骤

您需要删除 ppa,并确定造成依赖性问题的软件包该 PPA. 这些通常是您会在以下消息样式中找到的包

 libgl1-mesa-dev : Depends: libgl1-mesa-glx (= 1:17.2~git170422012800.d682f8a~z~padoka0) but 17.2~git1704220730.d682f8~gd~z is installed

您知道包的位置libgl1-mesa-glx高于apt与请求匹配的包 find libgl1-mesa-dev,从而产生了问题。

一旦您从该 ppa 中识别出有问题的软件包,您将使用此 apt 从其他 repo 安装软件包,而无需使用发布名称而不是版本字符串,如下所示(对于 16.04,发布名称为xenial

sudo apt install libgl1-mesa-dev/xenial

这将从具有存档名称的存储库中选择一个版本xenial(请注意,所有 ppa 都以此xenial作为存档名称)。由于安装的软件包不是来自xenial存档(它来自存档,但在删除 ppa 后,它来自 apt 的未知版本),因此apt将选择与同一版本一起提供的版本。大多数情况下,它是 Ubuntu 附带的官方存储库(除非您从其他 ppa 或存储库中获得了该软件包)。

令人惊讶的是,apt在这种情况下,它会表现得更聪明。它不会选择依赖项的最高版本libgl1-mesa-dev,而是选择依赖项中的最高版本指明释放这将来自官方 repo,即使这需要降级其他已安装的软件包,这也有效地解决了问题!

相关内容