我意外地使用 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
重新安装内核后,我正在处理图形驱动程序。
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
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.
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
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.
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
所以我相信它正在运行。还有什么值得检查的吗?
答案1
nvidia-390 是图形驱动程序 PPA 的一部分。
sudo /usr/bin/nvidia-uninstall
如果仍有手动安装的驱动程序,请运行以卸载该驱动程序。
删除旧的 NVIDIA 驱动程序的所有内容(先模拟):
sudo apt remove --purge -s nvidia-*
sudo apt remove --purge -s libnvidia-*
如果只需删除 nvidia 包,则真正删除:
sudo apt remove --purge nvidia-*
sudo apt remove --purge libnvidia-*
sudo apt update
再次运行ubuntu-drivers devices
。
如果仍然推荐 nvidia-390,请sudo ubuntu-drivers autoinstall
再次添加您的输出。