损坏的 apt,由于未满足的依赖项而无法更新 libglvnd (Nvidia)

pib*_*cco 13 apt nvidia dependencies budgie 18.04

我最近没有安装任何新软件包或添加任何 PPA,只是运行了 apt 更新。

运行“apt升级”后

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:
 libglvnd-dev : Depends: libglvnd0 (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
                Depends: libglvnd-core-dev (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
                Depends: libegl1 (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
                Depends: libgles2 (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
                Depends: libgl1 (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
                Depends: libglx0 (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
                Depends: libopengl0 (= 1.0.0-2ubuntu2.1) but 1.0.0-2ubuntu2.2 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Run Code Online (Sandbox Code Playgroud)

运行 'apt --fix-broken install' 或 'apt-get install -f' 后

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libgles1 libglvnd-dev
The following NEW packages will be installed:
  libgles1
The following packages will be upgraded:
  libglvnd-dev
1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/14.6 kB of archives.
After this operation, 66.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 686678 files and directories currently installed.)
Preparing to unpack .../libgles1_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libgles1:amd64 (1.0.0-2ubuntu2.2) ...
dpkg: error processing archive /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so.1', which is also in package nvidia-340 340.106-0ubuntu3
Preparing to unpack .../libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb ...
Unpacking libglvnd-dev:amd64 (1.0.0-2ubuntu2.2) over (1.0.0-2ubuntu2.1) ...
dpkg: error processing archive /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libGLESv1_CM.so', which is also in package nvidia-340 340.106-0ubuntu3
Errors were encountered while processing:
 /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb
 /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

我尝试暂时切换回 nouoveau,但由于 apt 被搞砸了,我不能。控制文件要求所有依赖项为 *-2.2,但是当我尝试升级时,它要求 *-2.1。

更新 我通过运行修复它

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb
sudo apt -f install
Run Code Online (Sandbox Code Playgroud)

And*_*res 8

@pibacco 关于问题的解决方案对我有用:

更新我通过运行修复它

sudo dpkg -i --force-overwrite /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.2_amd64.deb 
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libgles1_1.0.0-2ubuntu2.2_amd64.deb 
sudo apt -f install
sudo apt update
sudo apt upgrade
Run Code Online (Sandbox Code Playgroud)


小智 3

您需要通过以下方式完全删除软件包

sudo dpkg --purge --force-depends "libgles1" 
sudo dpkg --purge --force-depends "libglvnd-dev"
sudo apt-get autoremove
sudo apt-get clean
sudo apt-get install -f
Run Code Online (Sandbox Code Playgroud)

您还可以看到Can't Solution unmet dependencysudo apt-get -f install 失败