Ubuntu 版本:20.04.4 LTS
uname -r:5.15.0-41-通用
当我尝试运行“sudo apt upgrade”时,它执行了以下日志。
The following packages have been kept back:
libnvidia-cfg1-450 libnvidia-compute-450 libnvidia-compute-450:i386
libnvidia-decode-450 libnvidia-decode-450:i386 libnvidia-encode-450
libnvidia-encode-450:i386 libnvidia-extra-450 libnvidia-fbc1-450
libnvidia-fbc1-450:i386 libnvidia-gl-450 libnvidia-gl-450:i386
libnvidia-ifr1-450 libnvidia-ifr1-450:i386
linux-modules-nvidia-440-generic-hwe-20.04
linux-modules-nvidia-450-generic-hwe-20.04 nvidia-compute-utils-450
nvidia-dkms-450 nvidia-driver-450 nvidia-kernel-common-450
nvidia-kernel-source-450 nvidia-utils-450 xserver-xorg-video-nvidia-450
0 upgraded, 0 newly installed, 0 to remove and 23 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-dkms-450 (450.119.03-0ubuntu0.20.04.1) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
Removing old nvidia-450.119.03 DKMS files...
------------------------------
Deleting module version: 450.119.03
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-450.119.03 DKMS files...
Building for 5.15.0-41-generic
Building for architecture x86_64
Building initial module for 5.15.0-41-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-dkms-450
.0.crash'
**Error! Bad return status for module build on kernel: 5.15.0-41-generic (x86_64)
Consult /var/lib/dkms/nvidia/450.119.03/build/make.log for more information.**
dpkg: error processing package nvidia-dkms-450 (--configure):
installed nvidia-dkms-450 package post-installation script subprocess returned
error exit status 10
Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-41-generic
I: The initramfs will attempt to resume from /dev/sda3
I: (UUID=1fc25e34-c79f-4aa7-8260-da68de226617)
I: Set the RESUME variable to override this.
Errors were encountered while processing:
nvidia-dkms-450
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
Ubuntu 20.04 中保留的 nvidia-450 和 libnvidia-450 软件包是 nvidia-460 软件包的过渡软件包,而 nvidia-460 软件包又是 nvidia-470 的过渡软件包。手动更新到 nvidia-driver-470 将更新所有当前安装的过渡 nvidia 软件包。
打开终端并输入:
sudo apt update
sudo apt-get remove '^nvidia'
sudo apt autoremove
sudo reboot
重新启动后运行以下命令。
sudo apt update
sudo apt install nvidia-driver-470 nvidia-dkms-470
sudo reboot