类似的报错信息,就是卡在了nvidia-dkms-550无法安装
Loading new nvidia-550.40.07 DKMS files…
Building for 6.5.0-15-generic
Building for architecture x86_64
Building initial module for 6.5.0-15-generic
ERROR: Cannot create report: [Errno 17] File exists: ‘/var/crash/nvidia-dkms-550.0.crash’
Error! Bad return status for module build on kernel: 6.5.0-15-generic (x86_64)
Consult /var/lib/dkms/nvidia/550.40.07/build/make.log for more information.
dpkg: error processing package nvidia-dkms-550 (–configure):
installed nvidia-dkms-550 package post-installation script subprocess returned error exit status 10
Setting up libnvidia-encode-550:amd64 (550.40.07-0ubuntu0~gpu23.10.1) …
Setting up libnvidia-encode-550:i386 (550.40.07-0ubuntu0~gpu23.10.1) …
dpkg: dependency problems prevent configuration of nvidia-driver-550:
nvidia-driver-550 depends on nvidia-dkms-550 (<= 550.40.07-1); however:
Package nvidia-dkms-550 is not configured yet.
nvidia-driver-550 depends on nvidia-dkms-550 (>= 550.40.07); however:
Package nvidia-dkms-550 is not configured yet.
dpkg: error processing package nvidia-driver-550 (–configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
原因
GCC版本问题,虽然官方说6.0~13.0版本都支持。。但我这个gcc-11.4就是不行.于是更新gcc-12成功再去安装,成功解决!!
解决方案
首先,清除之前的相关文件,我们重新安装一遍。
sudo apt-get --purge remove "*nvidia*" "libxnvctrl*"
安装gcc12
# 查看之前的版本
> gcc --version
gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
> sudo apt-get install gcc-12 # 安装gcc12
# 将他添加到gcc备选组中,且设置优先级为12
> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
/usr/bin/gcc
主链接gcc
组名/usr/bin/gcc-12
要添加进组的链接12
优先级,越高约优先
查看gcc的链接设置
> sudo update-alternatives --config gcc
重新安装NVIDIA-DRIVER-550
我采用的是手动安装,而不是apt安装,
下载驱动的地址:
https://www.nvidia.cn/download/index.aspx
安装方式
# 添加执行权限
> sudo chmod +x "NVIDIA-Linux-x86_64-550.78.run"
# 执行安装
> sudo bash "NVIDIA-Linux-x86_64-550.78.run"
尝试无效的方法
正常安装流程无效
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-driver-550
手动下载库nvidia-dkms-550,安装也无效。
在ADDITIONAL DRIVER里面下载也无效 也会报错
即使有这个550驱动来源,也无法切换。