Score:0

Updating ubuntu 22.04 broke updates due to nvidia drivers

jp flag

A month or so ago I updated Ubuntu to 22.04, and since then have realised that whenever I try to install anything with something like sudo apt update && sudo apt install signal-desktop I get errors along the lines of:

Setting up nvidia-dkms-470 (470.161.03-0ubuntu0.22.04.1) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Removing old nvidia-470.161.03 DKMS files...
Deleting module nvidia-470.161.03 completely from the DKMS tree.
Loading new nvidia-470.161.03 DKMS files...
Building for 5.15.0-60-generic
Building for architecture x86_64
Building initial module for 5.15.0-60-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-kernel-source-470.0.crash'
Error! Bad return status for module build on kernel: 5.15.0-60-generic (x86_64)
Consult /var/lib/dkms/nvidia/470.161.03/build/make.log for more information.
dpkg: error processing package nvidia-dkms-470 (--configure): 
installed nvidia-dkms-470 package post-installation script subprocess
returned error exit status 10 dpkg: dependency problems prevent
configuration of nvidia-driver-470:  nvidia-driver-470 depends on
nvidia-dkms-470 (<= 470.161.03-1); however:
Package nvidia-dkms-470 is not configured yet.
nvidia-driver-470 depends on nvidia-dkms-470 (>= 470.161.03); however:
Package nvidia-dkms-470 is not configured yet.

dpkg: error processing package nvidia-driver-470 (--configure): 
dependency problems - leaving unconfigured dpkg:
dependency problems prevent configuration of nvidia-driver-460:
nvidia-driver-460 depends on nvidia-driver-470; however:
Package nvidia-driver-470 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 it's a follow-up error from a
previous failure.
                                                                                                            No apport report written because the error message indicates it's a
follow-up error from a prev ious failure.
             Processing triggers for initramfs-tools (0.140ubuntu13.1) ... update-initramfs: Generating /boot/initrd.img-5.15.0-60-generic

If I look in /var/lib/dkms/nvidia/470.161.03/build/make.log I can see:

DKMS make.log for nvidia-470.161.03 for kernel 5.15.0-60-generic
(x86_64) Mon 27 Feb 14:04:55 GMT 2023 make[1]: Entering directory
'/usr/src/linux-headers-5.15.0-60-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)

ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
make[1]: *** [Makefile:750: include/config/auto.conf] Error 1 make[1]:
Leaving directory '/usr/src/linux-headers-5.15.0-60-generic' make: ***
[Makefile:80: modules] Error 2

I have looked online, and tried uninstall/reinstall steps with no luck. I also cannot see a way to "configure".

If I try to run make oldconfig && make prepare all I get is:

make: *** No rule to make target 'oldconfig'. Stop.

Anyone had similar issues, or get any ideas I can try?


uname -r

5.15.0-60-generic

sudo apt install linux-headers-$(uname -r)

Reading package lists...
Done Building dependency tree...
Done Reading
state information...
Done linux-headers-5.15.0-60-generic is already the newest version (5.15.0-60.66). 0 to upgrade, 0 to newly install, 0 to remove and 42 not to upgrade. 3 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-470 (470.161.03-0ubuntu0.22.04.1) ...
update-initramfs: deferring update
(trigger activated)
INFO:Enable nvidia DEBUG:Parsing
/usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad 
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Removing old nvidia-470.161.03 DKMS files...
Deleting module nvidia-470.161.03 completely from the DKMS tree.
Loading new nvidia-470.161.03 DKMS files...
Building for 5.15.0-60-generic
Building for architecture x86_64
Building initial module for 5.15.0-60-generic
ERROR: Cannot create report: [Errno 17] File exists:
'/var/crash/nvidia-kernel-source-470.0.crash' Error! Bad return status for module build on kernel: 5.15.0-60-generic (x86_64)
Consult /var/lib/dkms/nvidia/470.161.03/build/make.log for more information.
dpkg: error processing package nvidia-dkms-470 (--configure): 
installed nvidia-dkms-470 package post-installation script subprocess
returned error exit status 10
dpkg: dependency problems prevent configuration of nvidia-driver-470:  nvidia-driver-470 depends on nvidia-dkms-470 (<= 470.161.03-1); however:   Package nvidia-dkms-470
is not configured yet.  nvidia-driver-470 depends on nvidia-dkms-470
(>= 470.161.03); however:   Package nvidia-dkms-470 is not configured yet.

dpkg: error processing package nvidia-driver-470 (--configure): 
dependency problems - leaving unconfigured dpkg: dependency problems
prevent configuration of nvidia-driver-460:  nvidia-driver-460 depends
on nvidia-driver-470; however:   Package nvidia-driver-470 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 it's a follow-up error from a previous failure.

No apport report written because the error message indicates it's a follow-up error from a prev ious failure.

Processing triggers for initramfs-tools (0.140ubuntu13.1) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-60-generic
Errors were encountered while processing:  nvidia-dkms-470 
nvidia-driver-470  nvidia-driver-460
E: Sub-process /usr/bin/dpkg returned an error code (1)
Khalid Abu Shawarib avatar
gb flag
What is the output of `uname -r` and `sudo apt install linux-headers-$(uname -r)`?
retrodans avatar
jp flag
Thanks @KhalidAbuShawarib have added outputs to the original post
Khalid Abu Shawarib avatar
gb flag
Do these two files exist? `dpkg -S /usr/src/linux-headers-5.15.0-60-generic/include/generated/autoconf.h` `dpkg -S /usr/src/linux-headers-5.15.0-60-generic/include/config/auto.conf`
retrodans avatar
jp flag
Looks like it yes ``` dan@dan-XPS-L521X:~$ dpkg -S /usr/src/linux-headers-5.15.0-60-generic/include/generated/autoconf.h linux-headers-5.15.0-60-generic: /usr/src/linux-headers-5.15.0-60-generic/include/generated/autoconf.h dan@dan-XPS-L521X:~$ dpkg -S /usr/src/linux-headers-5.15.0-60-generic/include/config/auto.conf linux-headers-5.15.0-60-generic: /usr/src/linux-headers-5.15.0-60-generic/include/config/auto.conf ```
retrodans avatar
jp flag
Scratch that, autoconf.h is not there: $ ls -la /usr/src/linux-headers-5.15.0-60-generic/include/generated/autoconf.h ls: cannot access '/usr/src/linux-headers-5.15.0-60-generic/include/generated/autoconf.h': No such file or directory
Khalid Abu Shawarib avatar
gb flag
OK, does reinstalling the headers solve it? `sudo apt install --reinstall linux-headers-$(uname -r)`
Khalid Abu Shawarib avatar
gb flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/143233/discussion-between-khalid-abu-shawarib-and-retrodans).
Score:0
gb flag

It seems that these files don't exist per the logs:

/usr/src/linux-headers-5.15.0-60-generic/include/generated/autoconf.h
/usr/src/linux-headers-5.15.0-60-generic/include/config/auto.conf

And since the linux-headers package which provide these files is already installed, the installation might have been corrupted. To reinstall the current kernel headers do:

sudo apt install --reinstall linux-headers-$(uname -r)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.