每次我尝试通过 apt 安装/更新时,都会收到与 NVIDIA 驱动程序相关的某种错误。例如,见下文(原来 g++ 已经安装,但我也为不存在的软件包收到此错误)。
我最近遇到了一个问题,Ubuntu 在更新后只能启动到终端。似乎它试图只启动到不再支持 340 驱动程序的内核版本(我想是 5.8?)。我已将其更改为启动到受支持的版本。这是在一台带有旧版 GPU/主板的办公机器上,因此目前无法升级。我想摆脱导致此问题的混乱安装,但我不知道从哪里开始。有什么建议吗?
sudo apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:9.3.0-1ubuntu2).
g++ set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nvidia-340 (340.108-0ubuntu2) ...
dpkg: error: version '-' has bad syntax: revision number is empty
dpkg: error: version '-' has bad syntax: revision number is empty
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia-340
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Removing old nvidia-340-340.108 DKMS files...
-------- Uninstall Beginning --------
Module: nvidia-340
Version: 340.108
Kernel: 5.4.0-58-generic (x86_64)
-------------------------------------
Status: Before uninstall, this module version was ACTIVE on this kernel.
nvidia.ko:
- Uninstallation
- Deleting from: /lib/modules/5.4.0-58-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
nvidia_uvm.ko:
- Uninstallation
- Deleting from: /lib/modules/5.4.0-58-generic/updates/dkms/
- Original module
- No original module was found for this module on this kernel.
- Use the dkms install command to reinstall any previous module version.
depmod...
DKMS: uninstall completed.
------------------------------
Deleting module version: 340.108
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-340-340.108 DKMS files...
Building for 5.4.0-58-generic 5.8.0-36-generic
Building for architecture x86_64
Building initial module for 5.4.0-58-generic
Done.
nvidia.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.4.0-58-generic/updates/dkms/
nvidia_uvm.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/5.4.0-58-generic/updates/dkms/
depmod...
DKMS: install completed.
Building initial module for 5.8.0-36-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-340.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-36-generic (x86_64)
Consult /var/lib/dkms/nvidia-340/340.108/build/make.log for more information.
dpkg: error processing package nvidia-340 (--configure):
installed nvidia-340 package post-installation script subprocess returned error exit status 10
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Processing triggers for initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: Generating /boot/initrd.img-5.8.0-36-generic
Errors were encountered while processing:
nvidia-340
E: Sub-process /usr/bin/dpkg returned an error code (1)