无法安装 nvidia-390 驱动程序,ubuntu 18.04

nat*_*sha 3 nvidia graphics

我不小心使用 StackExchange 建议中的这个命令卸载了我的活动内核和图形驱动程序:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
Run Code Online (Sandbox Code Playgroud)

重新安装内核后,我正在处理图形驱动程序。

ubuntu-drivers devices 返回:

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C03sv0000196Esd0000119Fbc03sc00i00
vendor   : NVIDIA Corporation
model    : GP106 [GeForce GTX 1060 6GB]
manual_install: True
driver   : nvidia-driver-390 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin
Run Code Online (Sandbox Code Playgroud)

sudo ubuntu-drivers autoinstall 返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have requested an 
impossible situation or if you are using the unstable distribution that some 
required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nvidia-driver-390 : Depends: nvidia-dkms-390 (= 390.48-0ubuntu3)
                 Recommends: libnvidia-compute-390:i386 (= 390.48-0ubuntu3)
                 Recommends: libnvidia-decode-390:i386 (= 390.48-0ubuntu3)
                 Recommends: libnvidia-encode-390:i386 (= 390.48-0ubuntu3)
                 Recommends: libnvidia-ifr1-390:i386 (= 390.48-0ubuntu3)
                 Recommends: libnvidia-fbc1-390:i386 (= 390.48-0ubuntu3)
                 Recommends: libnvidia-gl-390:i386 (= 390.48-0ubuntu3)
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

sudo apt install nvidia-390 返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package nvidia-390 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is 
only available from another source
However the following packages replace it:
  libnvidia-gl-390 nvidia-kernel-source-390:i386 nvidia-headless-no-dkms-390:i386 libnvidia-gl-390:i386
  nvidia-kernel-source-390 nvidia-headless-no-dkms-390

E: Package 'nvidia-390' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

sudo apt install -f 返回:

Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
The following packages were automatically installed and are no longer required: 
amd64-microcode intel-microcode iucode-tool libc-dev-bin thermald
Use 'sudo apt autoremove' to remove them.
Run Code Online (Sandbox Code Playgroud)

sudo add-apt-repository ppa:graphics-drivers 返回警告: This PPA is currently in testing, you should be experienced with packaging before you dive in here.

我没有包装经验,不想再把其他东西弄乱,所以我没有运行它。

附带问题:有谁知道我如何确定我的内核运行正常?也就是说,如果我重新启动计算机,它会启动吗?

uname -r 返回:

4.15.0-43-generic

所以我相信它正在发挥作用。还有什么其他明智的检查吗?

小智 8

nvidia-390 是图形驱动程序 PPA 的一部分。

运行sudo /usr/bin/nvidia-uninstall卸载手动安装的驱动程序,如果你还有一个。

删除旧的 NVIDIA 驱动程序的所有内容(先模拟):

sudo apt remove --purge -s nvidia-*
sudo apt remove --purge -s libnvidia-*
Run Code Online (Sandbox Code Playgroud)

如果只需要删除 nvidia 软件包,请真正删除:

sudo apt remove --purge nvidia-*
sudo apt remove --purge libnvidia-*
Run Code Online (Sandbox Code Playgroud)

运行sudo apt updateubuntu-drivers devices试。

如果仍然推荐使用 nvidia-390,请sudo ubuntu-drivers autoinstall再次添加您的输出。