[20200919]更新nvidia-kernel-dkms失败[已解决]
Tofloor
poster avatar
seasky
deepin
2020-09-19 15:33
Author
本帖最后由 gaohj 于 2020-9-26 07:19 编辑

自动更新时提示未完全安装。于是重新执行,执行过程和错误日志如下:

$ sudo apt install -f nvidia-kernel-dkms
Reading package lists... Done
Building dependency tree      
Reading state information... Done
nvidia-kernel-dkms is already the newest version (440.100-1).
nvidia-kernel-dkms set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 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-kernel-dkms (440.100-1) ...
Removing old nvidia-current-440.100 DKMS files...

------------------------------
Deleting module version: 440.100
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-current-440.100 DKMS files...
Building for 5.8.5-050805-generic
Building initial module for 5.8.5-050805-generic
Error! Bad return status for module build on kernel: 5.8.5-050805-generic (x86_64)
Consult /var/lib/dkms/nvidia-current/440.100/build/make.log for more information.
dpkg: error processing package nvidia-kernel-dkms (--configure):
installed nvidia-kernel-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
nvidia-kernel-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ cat /var/lib/dkms/nvidia-current/440.100/build/make.log
DKMS make.log for nvidia-current-440.100 for kernel 5.8.5-050805-generic (x86_64)
Sat 19 Sep 2020 07:25:05 AM CST
make  V=1 -C /lib/modules/5.8.5-050805-generic/build M=/var/lib/dkms/nvidia-current/440.100/build ARCH=x86_64 NV_KERNEL_SOURCES=/lib/modules/5.8.5-050805-generic/build NV_KERNEL_OUTPUT=/lib/modules/5.8.5-050805-generic/build NV_KERNEL_MODULES="nvidia nvidia-uvm nvidia-modeset nvidia-drm" INSTALL_MOD_DIR=kernel/drivers/video NV_SPECTRE_V2=0 modules
make[1]: Entering directory '/usr/src/linux-headers-5.8.5-050805-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-current/440.100/build \
single-build= \
need-builtin=1 need-modorder=1
scripts/Makefile.lib:8: 'always' is deprecated. Please use 'always-y' instead
NV_CONFTEST_CMD=/bin/sh /var/lib/dkms/nvidia-current/440.100/build/conftest.sh "gcc" x86_64 /lib/modules/5.8.5-050805-generic/build /lib/modules/5.8.5-050805-generic/build
NV_CONFTEST_CFLAGS=-O2 -D__KERNEL__ -DKBUILD_BASENAME="#conftest7796" -DKBUILD_MODNAME="#conftest7796" -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/8/include -I/lib/modules/5.8.5-050805-generic/build/arch/x86/include/asm/mach-default -I/lib/modules/5.8.5-050805-generic/build/include/asm-x86/mach-default -include /lib/modules/5.8.5-050805-generic/build/include/generated/autoconf.h -I/lib/modules/5.8.5-050805-generic/build/arch/x86/include -I/lib/modules/5.8.5-050805-generic/build/arch/x86/include/uapi -I/lib/modules/5.8.5-050805-generic/build/arch/x86/include/generated -I/lib/modules/5.8.5-050805-generic/build/arch/x86/include/generated/uapi -I/lib/modules/5.8.5-050805-generic/build/include -I/lib/modules/5.8.5-050805-generic/build/include/uapi -I/lib/modules/5.8.5-050805-generic/build/include/xen -I/lib/modules/5.8.5-050805-generic/build/include/generated/uapi  -I/var/lib/dkms/nvidia-current/440.100/build/common/inc -I/var/lib/dkms/nvidia-current/440.100/build -Wall -MD   -Wno-cast-qual -Wno-error -Wno-format-extra-args -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"440.100\" -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -Werror=undef -DNV_SPECTRE_V2=0 -fno-pie -Wall -Wundef -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -DCONFIG_X86_X32_ABI -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fstack-protector-strong -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -fmacro-prefix-map=./= -fcf-protection=none -Wno-packed-not-aligned
KBUILD_CFLAGS=-Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -DCONFIG_X86_X32_ABI -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow  -O2 --param=allow-store-data-races=0   -Wframe-larger-than=1024 -fstack-protector-strong -Wno-unused-but-set-variable -Wimplicit-fallthrough -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls  -fno-var-tracking-assignments -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY  -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-stringop-truncation  -Wno-array-bounds -Wno-stringop-overflow -Wno-restrict -Wno-maybe-uninitialized -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -fcf-protection=none -Wno-packed-not-aligned  
LINUXINCLUDE=-I./arch/x86/include -I./arch/x86/include/generated  -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h
LDFLAGS=
KBUILD_LDFLAGS=-m elf_x86_64  -z max-page-size=0x200000
ARCH=x86_64

Compiler version check failed:

The major and minor number of the compiler used to
compile the kernel:

gcc (Ubuntu 10.2.0-5ubuntu2) 10.2.0, GNU ld (GNU Binutils for Ubuntu) 2.35

does not match the compiler used here:

gcc (Uos 8.3.0.3-3+rebuild) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


It is recommended to set the CC environment variable
to the compiler that was used to compile the kernel.

The compiler version check can be disabled by setting
the IGNORE_CC_MISMATCH environment variable to "1".
However, mixing compiler versions between the kernel
and kernel modules can result in subtle bugs that are
difficult to diagnose.

*** Failed CC version check. Bailing out! ***

make[2]: *** [/var/lib/dkms/nvidia-current/440.100/build/Kbuild:208: cc_version_check] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1756: /var/lib/dkms/nvidia-current/440.100/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.8.5-050805-generic'
make: *** [Makefile:81: modules] Error 2




Reply Favorite View the author
All Replies
yk597590
deepin
2020-09-19 22:34
#1
可以去英伟达官网查一下你的显卡驱动版本 是不是440.110-1。
我之前碰到过这样的情况是因为官网提供的最新版本是434的,版本不匹配造成这种情况。
然后我就重新安装系统,安装界面的时候不要勾选闭源英伟达驱动选项就正常了
Reply View the author
然也
deepin
2020-09-20 00:18
#2
dpkg: 处理软件包 python-sklearn (–configure)时出错
子进程 已安装 post-installation 脚本 返回了错误号 1
https://blog.csdn.net/u011250160/article/details/107283322/
Reply View the author
SamLukeYes
deepin
2020-09-20 00:25
#3
你用的内核是用 gcc10 编译的,而你系统默认的是 gcc8,因此无法编译内核模块
Reply View the author
lcw0268
deepin
2020-09-20 00:53
#4
删除后再安装。
Reply View the author
seasky
deepin
2020-09-26 15:10
#5
https://bbs.deepin.org/post/202459
你用的内核是用 gcc10 编译的,而你系统默认的是 gcc8,因此无法编译内核模块 ...

我把gcc升级到10.2了,可是安装还是报同样的错(见后面日志),还能看出其他原因么?谢谢!

Loading new nvidia-current-440.100 DKMS files...
Building for 5.8.10-050810-generic
Building initial module for 5.8.10-050810-generic
Error! Bad return status for module build on kernel: 5.8.10-050810-generic (x86_64)
Consult /var/lib/dkms/nvidia-current/440.100/build/make.log for more information.
dpkg: 处理软件包 nvidia-kernel-dkms (--configure)时出错:
已安装 nvidia-kernel-dkms 软件包 post-installation 脚本 子进程返回错误状态 10
正在处理用于 desktop-file-utils (0.23-4) 的触发器 ...
正在处理用于 mime-support (3.62) 的触发器 ...
正在处理用于 lastore-daemon (5.1.0.10-1) 的触发器 ...
正在处理用于 bamfdaemon (0.5.4.1-1+eagle) 的触发器 ...
Rebuilding /usr/share/applications/bamf-2.index...
在处理时有错误发生:
nvidia-kernel-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
目标:x86_64-pc-linux-gnu
配置为:./configure --prefix=/usr/local/gcc --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
线程模型:posix
Supported LTO compression algorithms: zlib
gcc 版本 10.2.0 (GCC)
Reply View the author
seasky
deepin
2020-09-26 15:11
#6

现在是卸载也不行,总是提示不能完全卸载。
Reply View the author
seasky
deepin
2020-09-26 15:18
#7
https://bbs.deepin.org/post/202459
dpkg: 处理软件包 python-sklearn (–configure)时出错
子进程 已安装 post-installation 脚本 返回了错误 ...

按照链接里的方法处理,已经好了!多谢多谢!
看他的这些操作,好像是因为/var/lib/dpkg/info目前下有文件已经存在,导致了更新失败是么?
Reply View the author