web-dev-qa-db-ja.com

壊れたapt、依存関係が満たされていないためlibglvndを更新できません(Nvidia)

最近、新しいパッケージをインストールしたり、PPAを追加したりせず、apt更新を実行しました。

「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:
 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).

「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)

私は一時的にnouoveauに切り替えようとしましたが、台無しになったためにできませんでした。制御ファイルはすべての依存関係が* -2.2であることを要求しますが、アップグレードしようとすると* -2.1を要求しています。

UPDATEを実行して修正しました

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
10
pibacco

問題の@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
7
Andres

パッケージを完全に削除する必要があります

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

満たされていない依存関係を解決できない および Sudo apt-get -f install failed も表示できます。

2
nilesh_101