过程:
sudo ubuntu-drivers autoinstall
失败了
Setting up nvidia-dkms-440 (440.59-0ubuntu0~0.19.10.1) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Loading new nvidia-440.59 DKMS files...
Building for 5.3.0-40-generic
Building for architecture x86_64
Building initial module for 5.3.0-40-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-kernel-source-440.0.crash'
Error! Bad return status for module build on kernel: 5.3.0-40-generic (x86_64)
Consult /var/lib/dkms/nvidia/440.59/build/make.log for more information.
dpkg: error processing package nvidia-dkms-440 (--configure):
installed nvidia-dkms-440 package post-installation script subprocess returned error exit status 10
好的,让我们检查一下/var/lib/dkms/nvidia/440.59/build/make.log
:
DKMS make.log for nvidia-440.59 for kernel 5.3.0-40-generic (x86_64)
Mon 17 Feb 2020 12:33:02 PM CST
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-40-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia/440.59/build need-modorder=1
clang: error: unsupported option '-dumpspecs'
clang: error: no input files
make oldconfig && make prepare
失败:
等一下... 这会抛出clang
错误吗?见下文:
答案1
sudo update-alternatives --all
clang
将选定的所有内容更改回gcc
终于成功了。