今天我打开了电脑,之前使用 NVidia 驱动程序时,电脑以 1920x1080 的分辨率显示,现在却以低得多的分辨率运行,并且设置显示“未知显示”。
我收到了软件更新通知,在尝试应用更新时,我得到了以下信息:
我尝试安装开源 nouveau 驱动程序,但它一直回到 NVidia 驱动程序:
当我单击 Nouveau 驱动程序并单击“应用更改”时,它会显示一个进度条,但最后 NVidia 驱动程序显示为已选中。
我没有在这台机器上安装任何新软件,导致出现此问题。昨天它运行正常,今天我启动电脑时就出现了这种情况。
第二天阅读以下建议后:
以下命令似乎已成功:
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
但sudo apt install nvidia-driver-390
由于未满足依赖关系而失败:
jeff@haran-linux:~$ sudo apt install nvidia-driver-390
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:
libnvidia-ifr1-390 : Depends: libnvidia-gl-390 but it is not going to be installed
libnvidia-ifr1-390:i386 : Depends: libnvidia-gl-390:i386 but it is not going to be installed
nvidia-driver-390 : Depends: libnvidia-gl-390 (= 390.129-0ubuntu0~gpu18.04.1) but it is not going to be installed
Depends: nvidia-dkms-390 (= 390.129-0ubuntu0~gpu18.04.1)
Depends: nvidia-kernel-source-390 (= 390.129-0ubuntu0~gpu18.04.1)
Depends: libnvidia-compute-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: nvidia-compute-utils-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: libnvidia-decode-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: libnvidia-encode-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: nvidia-utils-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: xserver-xorg-video-nvidia-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: libnvidia-cfg1-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: libnvidia-ifr1-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Depends: libnvidia-fbc1-390 (= 390.129-0ubuntu0~gpu18.04.1) but 390.116-0ubuntu0.18.04.1 is to be installed
Recommends: libnvidia-compute-390:i386 (= 390.129-0ubuntu0~gpu18.04.1)
Recommends: libnvidia-decode-390:i386 (= 390.129-0ubuntu0~gpu18.04.1)
Recommends: libnvidia-encode-390:i386 (= 390.129-0ubuntu0~gpu18.04.1)
Recommends: libnvidia-ifr1-390:i386 (= 390.129-0ubuntu0~gpu18.04.1)
Recommends: libnvidia-fbc1-390:i386 (= 390.129-0ubuntu0~gpu18.04.1)
Recommends: libnvidia-gl-390:i386 (= 390.129-0ubuntu0~gpu18.04.1)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
jeff@haran-linux:~$
所以我尝试了apt --fix-broken install
但也有错误:
jeff@haran-linux:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
lib32gcc1 libc6-i386 libllvm7 libllvm7:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libnvidia-cfg1-390 libnvidia-compute-390 libnvidia-compute-390:i386 libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390
libnvidia-encode-390:i386 libnvidia-fbc1-390 libnvidia-fbc1-390:i386 libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390
libnvidia-ifr1-390:i386 nvidia-compute-utils-390 nvidia-dkms-390 nvidia-driver-390 nvidia-kernel-source-390 nvidia-utils-390
xserver-xorg-video-nvidia-390
The following NEW packages will be installed:
libnvidia-gl-390 libnvidia-gl-390:i386
The following packages will be upgraded:
libnvidia-cfg1-390 libnvidia-compute-390 libnvidia-compute-390:i386 libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390
libnvidia-encode-390:i386 libnvidia-fbc1-390 libnvidia-fbc1-390:i386 libnvidia-ifr1-390 libnvidia-ifr1-390:i386
nvidia-compute-utils-390 nvidia-dkms-390 nvidia-driver-390 nvidia-kernel-source-390 nvidia-utils-390 xserver-xorg-video-nvidia-390
17 upgraded, 2 newly installed, 0 to remove and 43 not upgraded.
3 not fully installed or removed.
Need to get 84.5 MB of archives.
After this operation, 149 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-driver-390 amd64 390.129-0ubuntu0~gpu18.04.1 [394 kB]
Get:2 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-gl-390 amd64 390.129-0ubuntu0~gpu18.04.1 [14.3 MB]
Get:3 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-dkms-390 amd64 390.129-0ubuntu0~gpu18.04.1 [28.2 kB]
Get:4 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-kernel-source-390 amd64 390.129-0ubuntu0~gpu18.04.1 [8,568 kB]
Get:5 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-decode-390 amd64 390.129-0ubuntu0~gpu18.04.1 [1,121 kB]
Get:6 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 libnvidia-decode-390 i386 390.129-0ubuntu0~gpu18.04.1 [1,190 kB]
Get:7 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 libnvidia-compute-390 i386 390.129-0ubuntu0~gpu18.04.1 [21.0 MB]
Get:8 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-compute-390 amd64 390.129-0ubuntu0~gpu18.04.1 [20.6 MB]
Get:9 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-compute-utils-390 amd64 390.129-0ubuntu0~gpu18.04.1 [70.4 kB]
Get:10 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 libnvidia-encode-390 i386 390.129-0ubuntu0~gpu18.04.1 [54.6 kB]
Get:11 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-encode-390 amd64 390.129-0ubuntu0~gpu18.04.1 [54.3 kB]
Get:12 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-utils-390 amd64 390.129-0ubuntu0~gpu18.04.1 [327 kB]
Get:13 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 xserver-xorg-video-nvidia-390 amd64 390.129-0ubuntu0~gpu18.04.1 [1,617 kB]
Get:14 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-cfg1-390 amd64 390.129-0ubuntu0~gpu18.04.1 [71.9 kB]
Get:15 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 libnvidia-fbc1-390 i386 390.129-0ubuntu0~gpu18.04.1 [40.2 kB]
Get:16 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-fbc1-390 amd64 390.129-0ubuntu0~gpu18.04.1 [43.3 kB]
Get:17 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libnvidia-ifr1-390 amd64 390.129-0ubuntu0~gpu18.04.1 [70.9 kB]
Get:18 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 libnvidia-ifr1-390 i386 390.129-0ubuntu0~gpu18.04.1 [64.0 kB]
Get:19 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main i386 libnvidia-gl-390 i386 390.129-0ubuntu0~gpu18.04.1 [14.9 MB]
Fetched 84.5 MB in 26s (3,290 kB/s)
(Reading database ... 177663 files and directories currently installed.)
Preparing to unpack .../00-nvidia-driver-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking nvidia-driver-390 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../01-libnvidia-gl-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-390'
found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /tmp/apt-dpkg-install-lvXGM8/01-libnvidia-gl-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb (--unpack):
new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../02-nvidia-dkms-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Removing all DKMS Modules
Done.
Unpacking nvidia-dkms-390 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../03-nvidia-kernel-source-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking nvidia-kernel-source-390 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../04-libnvidia-decode-390_390.129-0ubuntu0~gpu18.04.1_i386.deb ...
De-configuring libnvidia-decode-390:amd64 (390.116-0ubuntu0.18.04.1) ...
Unpacking libnvidia-decode-390:i386 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../05-libnvidia-decode-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking libnvidia-decode-390:amd64 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../06-libnvidia-compute-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
De-configuring libnvidia-compute-390:i386 (390.116-0ubuntu0.18.04.1) ...
Unpacking libnvidia-compute-390:amd64 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../07-libnvidia-compute-390_390.129-0ubuntu0~gpu18.04.1_i386.deb ...
Unpacking libnvidia-compute-390:i386 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../08-nvidia-compute-utils-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking nvidia-compute-utils-390 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../09-libnvidia-encode-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
De-configuring libnvidia-encode-390:i386 (390.116-0ubuntu0.18.04.1) ...
Unpacking libnvidia-encode-390:amd64 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../10-libnvidia-encode-390_390.129-0ubuntu0~gpu18.04.1_i386.deb ...
Unpacking libnvidia-encode-390:i386 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../11-nvidia-utils-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking nvidia-utils-390 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../12-xserver-xorg-video-nvidia-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking xserver-xorg-video-nvidia-390 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../13-libnvidia-cfg1-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking libnvidia-cfg1-390:amd64 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../14-libnvidia-fbc1-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
De-configuring libnvidia-fbc1-390:i386 (390.116-0ubuntu0.18.04.1) ...
Unpacking libnvidia-fbc1-390:amd64 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../15-libnvidia-fbc1-390_390.129-0ubuntu0~gpu18.04.1_i386.deb ...
Unpacking libnvidia-fbc1-390:i386 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../16-libnvidia-ifr1-390_390.129-0ubuntu0~gpu18.04.1_i386.deb ...
Unpacking libnvidia-ifr1-390:i386 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../17-libnvidia-ifr1-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb ...
Unpacking libnvidia-ifr1-390:amd64 (390.129-0ubuntu0~gpu18.04.1) over (390.116-0ubuntu0.18.04.1) ...
Preparing to unpack .../18-libnvidia-gl-390_390.129-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 /tmp/apt-dpkg-install-lvXGM8/18-libnvidia-gl-390_390.129-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:
/tmp/apt-dpkg-install-lvXGM8/01-libnvidia-gl-390_390.129-0ubuntu0~gpu18.04.1_amd64.deb
/tmp/apt-dpkg-install-lvXGM8/18-libnvidia-gl-390_390.129-0ubuntu0~gpu18.04.1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
jeff@haran-linux:~$
几天后... 我只是想把这件事做个了结。我最终从我刻录的最新 ISO 安装 DVD 重新安装了 18.04。我很感谢提出的建议,但似乎一旦 PC 进入这种“软件包系统已损坏”状态,除了重新安装所有内容外,没有其他办法可以解决。至少提供的建议不足以修复系统。
以下是我从这次经历中得出的结论。如果使用 NVidia 驱动程序,Ubuntu 的系统更新可能会导致安装与驱动程序不兼容的内核。一旦发生这种情况,似乎除了重新安装整个系统外,没有任何简单的恢复方法。而且由于最新的 Ubuntu 安装 DVD 不再包含重新安装现有系统而不清除 /home 目录内容的选项,因此重新安装可能会变成一个相当耗时的过程(我花了两天时间将我家里的内容复制到另一台电脑上,然后在重新安装后从另一台电脑上恢复,我的电脑上有很多照片)。
因此,如果我收到包含新内核的 Ubuntu 系统更新,我将首先将系统切换回使用 Nouveau 驱动程序。您可能也想这样做。
请注意,我还没有尝试升级和安装较新的 NVidia 驱动程序。我希望如果它与新内核不兼容,我的 PC 不会最终处于相同的“软件包系统已损坏”状态。至少这一次,如果确实如此,我已经备份了我的 /home,因此恢复应该不到 2 天。
感谢在这里试图帮助我的响应者。
答案1
最近,Ubuntu 18.04 上的内核已升级到 5.3。
官方存储库中的 390.116 不能使用 5.3 内核构建。
你可以通过从 PPA 安装 390.129 Nvidia 驱动程序来修复此问题。运行
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-390
sudo apt upgrade
重新启动,一切即可正常运行。
答案2
我遇到了类似的问题。笔记本电脑无法检测到第二台显示器。Nvidia-smi 返回以下错误:
“nvidia-SMI 失败,因为它无法与 NVIDIA 驱动程序通信。请确保最新的 NVIDIA 驱动程序已安装并正在运行。”
我试过后它起作用了:
sudo apt purge nvidia-*
答案3
对我来说,解决方案是在 bios 中禁用“安全启动”。Nvidia 驱动程序不喜欢它。