Nvidia-dkms-460 Error

I have not relaized If this error was issued. I face the same problem with the other version also (450,440 etc). When i command sudo apt install nvidia-driver-460 the output is as below;

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following package was automatically installed and is no longer required:
libfprint-2-tod1
Use ‘sudo apt autoremove’ to remove it.
The following additional packages will be installed:
libnvidia-cfg1-460 libnvidia-common-460 libnvidia-compute-460
libnvidia-compute-460:i386 libnvidia-decode-460 libnvidia-decode-460:i386
libnvidia-encode-460 libnvidia-encode-460:i386 libnvidia-extra-460
libnvidia-fbc1-460 libnvidia-fbc1-460:i386 libnvidia-gl-460
libnvidia-gl-460:i386 libnvidia-ifr1-460 libnvidia-ifr1-460:i386
nvidia-compute-utils-460 nvidia-dkms-460 nvidia-kernel-common-460
nvidia-kernel-source-460 nvidia-prime nvidia-settings nvidia-utils-460
xserver-xorg-video-nvidia-460
The following packages will be REMOVED:
libnvidia-cfg1-450 libnvidia-common-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
xserver-xorg-video-nvidia-450
The following NEW packages will be installed:
libnvidia-cfg1-460 libnvidia-common-460 libnvidia-compute-460
libnvidia-compute-460:i386 libnvidia-decode-460 libnvidia-decode-460:i386
libnvidia-encode-460 libnvidia-encode-460:i386 libnvidia-extra-460
libnvidia-fbc1-460 libnvidia-fbc1-460:i386 libnvidia-gl-460
libnvidia-gl-460:i386 libnvidia-ifr1-460 libnvidia-ifr1-460:i386
nvidia-compute-utils-460 nvidia-dkms-460 nvidia-driver-460
nvidia-kernel-common-460 nvidia-kernel-source-460 nvidia-prime
nvidia-settings nvidia-utils-460 xserver-xorg-video-nvidia-460
0 upgraded, 24 newly installed, 16 to remove and 0 not upgraded.
Need to get 0 B/176 MB of archives.
After this operation, 98.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database … 286326 files and directories currently installed.)
Removing xserver-xorg-video-nvidia-450 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-cfg1-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-ifr1-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-gl-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-ifr1-450:i386 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-gl-450:i386 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-common-450 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-encode-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-decode-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-compute-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-encode-450:i386 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-decode-450:i386 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-compute-450:i386 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-extra-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-fbc1-450:i386 (450.102.04-0ubuntu0.20.04.2) …
Removing libnvidia-fbc1-450:amd64 (450.102.04-0ubuntu0.20.04.2) …
Selecting previously unselected package libnvidia-cfg1-460:amd64.
(Reading database … 286186 files and directories currently installed.)
Preparing to unpack …/00-libnvidia-cfg1-460_460.67-0ubuntu0~0.20.04.1_amd64.de
b …
Unpacking libnvidia-cfg1-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-common-460.
Preparing to unpack …/01-libnvidia-common-460_460.67-0ubuntu0~0.20.04.1_all.de
b …
Unpacking libnvidia-common-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-compute-460:amd64.
Preparing to unpack …/02-libnvidia-compute-460_460.67-0ubuntu0~0.20.04.1_amd64
.deb …
Unpacking libnvidia-compute-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-compute-460:i386.
Preparing to unpack …/03-libnvidia-compute-460_460.67-0ubuntu0~0.20.04.1_i386.
deb …
Unpacking libnvidia-compute-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-decode-460:amd64.
Preparing to unpack …/04-libnvidia-decode-460_460.67-0ubuntu0~0.20.04.1_amd64.
deb …
Unpacking libnvidia-decode-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-decode-460:i386.
Preparing to unpack …/05-libnvidia-decode-460_460.67-0ubuntu0~0.20.04.1_i386.d
eb …
Unpacking libnvidia-decode-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-encode-460:i386.
Preparing to unpack …/06-libnvidia-encode-460_460.67-0ubuntu0~0.20.04.1_i386.d
eb …
Unpacking libnvidia-encode-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-encode-460:amd64.
Preparing to unpack …/07-libnvidia-encode-460_460.67-0ubuntu0~0.20.04.1_amd64.
deb …
Unpacking libnvidia-encode-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-extra-460:amd64.
Preparing to unpack …/08-libnvidia-extra-460_460.67-0ubuntu0~0.20.04.1_amd64.d
eb …
Unpacking libnvidia-extra-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-fbc1-460:amd64.
Preparing to unpack …/09-libnvidia-fbc1-460_460.67-0ubuntu0~0.20.04.1_amd64.de
b …
Unpacking libnvidia-fbc1-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-fbc1-460:i386.
Preparing to unpack …/10-libnvidia-fbc1-460_460.67-0ubuntu0~0.20.04.1_i386.deb

Unpacking libnvidia-fbc1-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-gl-460:i386.
Preparing to unpack …/11-libnvidia-gl-460_460.67-0ubuntu0~0.20.04.1_i386.deb .

Unpacking libnvidia-gl-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-gl-460:amd64.
Preparing to unpack …/12-libnvidia-gl-460_460.67-0ubuntu0~0.20.04.1_amd64.deb

Unpacking libnvidia-gl-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-ifr1-460:i386.
Preparing to unpack …/13-libnvidia-ifr1-460_460.67-0ubuntu0~0.20.04.1_i386.deb

Unpacking libnvidia-ifr1-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package libnvidia-ifr1-460:amd64.
Preparing to unpack …/14-libnvidia-ifr1-460_460.67-0ubuntu0~0.20.04.1_amd64.de
b …
Unpacking libnvidia-ifr1-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-compute-utils-460.
Preparing to unpack …/15-nvidia-compute-utils-460_460.67-0ubuntu0~0.20.04.1_am
d64.deb …
Unpacking nvidia-compute-utils-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-kernel-source-460.
Preparing to unpack …/16-nvidia-kernel-source-460_460.67-0ubuntu0~0.20.04.1_am
d64.deb …
Unpacking nvidia-kernel-source-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-kernel-common-460.
Preparing to unpack …/17-nvidia-kernel-common-460_460.67-0ubuntu0~0.20.04.1_am
d64.deb …
Unpacking nvidia-kernel-common-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-dkms-460.
Preparing to unpack …/18-nvidia-dkms-460_460.67-0ubuntu0~0.20.04.1_amd64.deb .

Unpacking nvidia-dkms-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-utils-460.
Preparing to unpack …/19-nvidia-utils-460_460.67-0ubuntu0~0.20.04.1_amd64.deb

Unpacking nvidia-utils-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package xserver-xorg-video-nvidia-460.
Preparing to unpack …/20-xserver-xorg-video-nvidia-460_460.67-0ubuntu0~0.20.04
.1_amd64.deb …
Unpacking xserver-xorg-video-nvidia-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-driver-460.
Preparing to unpack …/21-nvidia-driver-460_460.67-0ubuntu0~0.20.04.1_amd64.deb

Unpacking nvidia-driver-460 (460.67-0ubuntu0~0.20.04.1) …
Selecting previously unselected package nvidia-prime.
Preparing to unpack …/22-nvidia-prime_0.8.16~0.20.04.1_all.deb …
Unpacking nvidia-prime (0.8.16~0.20.04.1) …
Selecting previously unselected package nvidia-settings.
Preparing to unpack …/23-nvidia-settings_460.39-0ubuntu0.20.04.1_amd64.deb …
Unpacking nvidia-settings (460.39-0ubuntu0.20.04.1) …
Setting up libnvidia-common-460 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-fbc1-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-fbc1-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Setting up nvidia-prime (0.8.16~0.20.04.1) …
Setting up libnvidia-compute-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-compute-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Setting up nvidia-kernel-common-460 (460.67-0ubuntu0~0.20.04.1) …
update-initramfs: deferring update (trigger activated)
Setting up libnvidia-cfg1-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up xserver-xorg-video-nvidia-460 (460.67-0ubuntu0~0.20.04.1) …
Setting up nvidia-kernel-source-460 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-gl-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-gl-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Setting up nvidia-settings (460.39-0ubuntu0.20.04.1) …
Setting up libnvidia-extra-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up nvidia-utils-460 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-decode-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-decode-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-ifr1-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-ifr1-460:i386 (460.67-0ubuntu0~0.20.04.1) …
Setting up nvidia-compute-utils-460 (460.67-0ubuntu0~0.20.04.1) …
Warning: The home dir /nonexistent you specified can’t be accessed: No such file
or directory
Adding system user nvidia-persistenced' (UID 126) ... Adding new group nvidia-persistenced’ (GID 133) …
Adding new user nvidia-persistenced' (UID 126) with group nvidia-persistenced’

Not creating home directory `/nonexistent’.
Setting up nvidia-dkms-460 (460.67-0ubuntu0~0.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/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Loading new nvidia-460.67 DKMS files…
Building for 5.8.0-48-generic
Building for architecture x86_64
Building initial module for 5.8.0-48-generic
ERROR: Cannot create report: [Errno 17] File exists: ‘/var/crash/nvidia-dkms-460
.0.crash’
Error! Bad return status for module build on kernel: 5.8.0-48-generic (x86_64)
Consult /var/lib/dkms/nvidia/460.67/build/make.log for more information.
dpkg: error processing package nvidia-dkms-460 (–configure):
installed nvidia-dkms-460 package post-installation script subprocess returned
error exit status 10
Setting up libnvidia-encode-460:amd64 (460.67-0ubuntu0~0.20.04.1) …
Setting up libnvidia-encode-460:i386 (460.67-0ubuntu0~0.20.04.1) …
dpkg: dependency problems prevent configuration of nvidia-driver-460:
nvidia-driver-460 depends on nvidia-dkms-460 (<= 460.67-1); however:
Package nvidia-dkms-460 is not configured yet.
nvidia-driver-460 depends on nvidia-dkms-460 (>= 460.67); however:
Package nvidia-dkms-460 is not configured yet.

dpkg: error processing package nvidia-driver-460 (–configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup erro
r from a previous failure.
Processing triggers for mime-support (3.64ubuntu1) …
Processing triggers for gnome-menus (3.36.0-1ubuntu1) …
Processing triggers for libc-bin (2.31-0ubuntu9.2) …
Processing triggers for man-db (2.9.1-1) …
Processing triggers for desktop-file-utils (0.24-1ubuntu3) …
Processing triggers for initramfs-tools (0.136ubuntu6.4) …
update-initramfs: Generating /boot/initrd.img-5.8.0-48-generic
Errors were encountered while processing:
nvidia-dkms-460
nvidia-driver-460
E: Sub-process /usr/bin/dpkg returned an error code (1)

I will be very grateful if you help me to solve this issue.

Thank you in advance.

Please provide that file.
Are the linux-headers installed? (linux-headers-5.8.0-48-generic).
Please also run nvidia-bug-report.sh as root and attach the resulting file here.
I suspect a compiler mismatch.

here is nvidia-bug-report: nvidia-bug-report.log (3.3 MB)

And it seems linux-headers are install as i see. You can verify in picture below;

Thank you for your replying

gcc version 6.4.0 20180424 (Ubuntu 6.4.0-17ubuntu1)

*** /proc/version
*** ls: -r–r–r-- 1 root root 0 2021-03-26 11:05:06.306296949 +0300 /proc/version
Linux version 5.8.0-48-generic (buildd@lgw01-amd64-008) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021

As suspected a compiler mismatch. Your kernel was built with gcc v.9.3. But you try to compile the kernel module with 6.4.
Please switch cc and gcc to 9.3 using update-alternatives.

I am new in ubuntu. So could you tell me that how can i update kernel module by using update-alternatives

You need to set the compiler to the right version (9.3). This will be used to build your kernel modules.
First get an overview what is set on your system:

ls -l /usr/bin/cc*
ls -l /usr/bin/gcc*
ls -l /usr/bin/g++*

update-alternatives --display cc
update-alternatives --display c++

Then set the alternative accordingly.
in example:

update-alternatives --set cc gcc-9
update-alternatives --set c++ g++-9