![如何修复我的视频驱动程序的安装错误?](https://linux22.com/image/1161766/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%E6%88%91%E7%9A%84%E8%A7%86%E9%A2%91%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E7%9A%84%E5%AE%89%E8%A3%85%E9%94%99%E8%AF%AF%EF%BC%9F.png)
这是我在尝试安装 nvidia 驱动程序 libnvidia-gl-390_390.87 时不断收到的错误消息。有人能帮我解决这个问题吗?请注意,我在 ubuntu 上遇到了问题。
(Reading database ... 210321 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-390'
found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_i386.deb (--unpack):
new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
dpkg: dependency problems prevent configuration of nvidia-driver-390:
nvidia-driver-390 depends on libnvidia-gl-390 (= 390.87-0ubuntu0~gpu18.04.1); however:
Package libnvidia-gl-390:i386 is not installed.
dpkg: error processing package nvidia-driver-390 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnvidia-ifr1-390:i386:
libnvidia-ifr1-390:i386 depends on libnvidia-gl-390; however:
Package libnvidia-gl-390:i386 is not installed.
dpkg: error processing package libnvidia-ifr1-390:i386 (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1) ...
/sbin/ldconfig.real: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf: No such file or directory
/sbin/ldconfig.real: Warning: ignoring configuration file that cannot be opened: /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf: No such file or directory
Errors were encountered while processing:
nvidia-driver-390
libnvidia-ifr1-390:i386
答案1
输出显示libnvidia-gl-390:i386
未安装,看起来libnvidia-gl-390:i386
需要安装才能解决问题。运行以下命令并发布任何错误:
sudo apt update
sudo apt install --reinstall libnvidia-gl-390:i386
sudo apt -f install
sudo dpkg --configure -a
如果出现错误,请发布错误。
答案2
好的...我发现在 ubuntu 论坛上其他人也遇到了与我相同的问题。
我在终端尝试了这个建议......
LC_MESSAGES=C dpkg-divert --list 'NVIDIA-340' | sed -nre 's/^diversion (。) 到 。/\1/p' | xargs -rd'\n' -n1 -- sudo dpkg-divert --remove sudo apt --fix-broken install
之后我运行 sudo apt --fix broken install
然后运行 sudo apt upgrade
这对我有用。谢谢你的帮助