0

After doing a normal apt update && apt upgrade I get a kernel panic on reboot. I fixed it entering a shell from the old kernel recovery mode and then issuing:

mount -o remount,rw /
mkinitramfs -o /boot/initrd.img-6.5.0-14-generic 6.5.0-14-generic
update-grub

In this way I was able to boot again my Ubuntu 23.10. But now every time apt is invoked it fails with the following messages (I apologize, some of the words are in Italian):

Configurazione di linux-headers-6.5.0-14-generic (6.5.0-14.14)...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 6.5.0-14-generic
Sign command: /usr/bin/kmodsign
Signing key: /var/lib/shim-signed/mok/MOK.priv
Public certificate (MOK): /var/lib/shim-signed/mok/MOK.der

Building module: Cleaning build area... make -j8 KERNELRELEASE=6.5.0-14-generic default KERNELVERSION=6.5.0-14-generic.. .(bad exit status: 2) ERROR (dkms apport): binary package for ch340: 1.0.0 not found Error! Bad return status for module build on kernel: 6.5.0-14-generic (x86_64) Consult /var/lib/dkms/ch340/1.0.0/build/make.log for more information. dkms autoinstall on 6.5.0-14-generic/x86_64 succeeded for nvidia virtualbox dkms autoinstall on 6.5.0-14-generic/x86_64 failed for ch340(10) Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information.

  • dkms: autoinstall for kernel 6.5.0-14-generic ...fail!

run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11 dpkg: errore nell'elaborare il pacchetto linux-headers-6.5.0-14-generic (--confi gure): il sottoprocesso installato pacchetto linux-headers-6.5.0-14-generic script pos t-installation ha restituito lo stato di errore 1 dpkg: problemi con le dipendenze impediscono la configurazione di linux-headers- generic: linux-headers-generic dipende da linux-headers-6.5.0-14-generic; tuttavia: Il pacchetto linux-headers-6.5.0-14-generic non è ancora configurato.

dpkg: errore nell'elaborare il pacchetto linux-headers-generic (--configure): problemi con le dipendenze - lasciato non configurato Configurazione di linux-image-6.5.0-14-generic (6.5.0-14.14)... Segnalazione apport non scritta poiché il messaggio di errore indica la presenza di un fallimento precedente. dpkg: problemi con le dipendenze impediscono la con figurazione di linux-headers-generic-hwe-22.04: linux-headers-generic-hwe-22.04 dipende da linux-headers-6.5.0-14-generic; tutt avia: Il pacchetto linux-headers-6.5.0-14-generic non è ancora configurato.

dpkg: errore nell'elaborare il pacchetto linux-headers-generic-hwe-22.04 (--conf igure): problemi con le dipendenze - lasciato non configurato Segnalazione apport non scritta poiché il messaggio di errore indica la presenza di un fallimento precedente. Segnalazione apport non scritta poiché è stato ragg iunto il valore massimo di MaxReports Segnalazione apport non scritta poiché è st ato raggiunto il valore massimo di MaxReports dpkg: problemi con le dipendenze im pediscono la configurazione di linux-generic-hwe-22.04: linux-generic-hwe-22.04 dipende da linux-headers-generic-hwe-22.04 (= 6.5.0.14. 16); tuttavia: Il pacchetto linux-headers-generic-hwe-22.04 non è ancora configurato.

dpkg: errore nell'elaborare il pacchetto linux-generic-hwe-22.04 (--configure): problemi con le dipendenze - lasciato non configurato dpkg: problemi con le dipendenze impediscono la configurazione di linux-generic: linux-generic dipende da linux-headers-generic (= 6.5.0.14.16); tuttavia: Il pacchetto linux-headers-generic non è ancora configurato.

dpkg: errore nell'elaborare il pacchetto linux-generic (--configure): problemi con le dipendenze - lasciato non configurato Elaborazione dei trigger per dbus (1.14.10-1ubuntu1)... Elaborazione dei trigger per mailcap (3.70+nmu1ubuntu1)... Elaborazione dei trigger per desktop-file-utils (0.26-1ubuntu5)... Elaborazione dei trigger per hicolor-icon-theme (0.17-2)... Elaborazione dei trigger per gnome-menus (3.36.0-1.1ubuntu1)... Si sono verificati degli errori nell'elaborazione: linux-headers-6.5.0-14-generic linux-headers-generic linux-headers-generic-hwe-22.04 linux-generic-hwe-22.04 linux-generic E: Sub-process /usr/bin/dpkg returned an error code (1)

I see a lot of errors but I'm able to understand which one is the root cause. My wild guess is:

ERROR (dkms apport): binary package for ch340: 1.0.0 not found

I read this question but sudo dpkg -l | grep ch340 returns nothing. While sudo dpkg -l | grep dkms returns:

ii  dkms                                          3.0.11-1ubuntu10                           all          Dynamic Kernel Module System (DKMS)
ii  nvidia-dkms-470                               470.223.02-0ubuntu0.23.10.1                amd64        NVIDIA DKMS package
ii  virtualbox-dkms                               7.0.10-dfsg-3                              amd64        x86 virtualization solution - kernel module sources for dkms

Can you help me to understand how to fix this issue?

UPDATE

$ dkms status
ch340/1.0.0: added
nvidia/470.223.02, 6.5.0-10-generic, x86_64: installed
nvidia/470.223.02, 6.5.0-14-generic, x86_64: installed
virtualbox/7.0.10, 6.5.0-10-generic, x86_64: installed
virtualbox/7.0.10, 6.5.0-14-generic, x86_64: installed

$ tree /var/lib/dkms/ /var/lib/dkms/ ├── ch340 │   └── 1.0.0 │   ├── build │   │   ├── ch340.c │   │   ├── ch340.mod │   │   ├── dkms.conf │   │   ├── Dockerfile │   │   ├── Makefile │   │   ├── make.log │   │   └── README.md │   └── source -> /usr/src/ch340-1.0.0 ├── nvidia │   ├── 470.223.02 │   │   ├── 6.5.0-10-generic │   │   │   └── x86_64 │   │   │   ├── log │   │   │   │   └── make.log │   │   │   └── module │   │   │   ├── nvidia-drm.ko.zst │   │   │   ├── nvidia.ko.zst │   │   │   ├── nvidia-modeset.ko.zst │   │   │   ├── nvidia-peermem.ko.zst │   │   │   └── nvidia-uvm.ko.zst │   │   ├── 6.5.0-14-generic │   │   │   └── x86_64 │   │   │   ├── log │   │   │   │   └── make.log │   │   │   └── module │   │   │   ├── nvidia-drm.ko.zst │   │   │   ├── nvidia.ko.zst │   │   │   ├── nvidia-modeset.ko.zst │   │   │   ├── nvidia-peermem.ko.zst │   │   │   └── nvidia-uvm.ko.zst │   │   └── source -> /usr/src/nvidia-470.223.02 │   ├── kernel-6.5.0-10-generic-x86_64 -> 470.223.02/6.5.0-10-generic/x86_64 │   └── kernel-6.5.0-14-generic-x86_64 -> 470.223.02/6.5.0-14-generic/x86_64 └── virtualbox ├── 7.0.10 │   ├── 6.5.0-10-generic │   │   └── x86_64 │   │   ├── log │   │   │   └── make.log │   │   └── module │   │   ├── vboxdrv.ko.zst │   │   ├── vboxnetadp.ko.zst │   │   └── vboxnetflt.ko.zst │   ├── 6.5.0-14-generic │   │   └── x86_64 │   │   ├── log │   │   │   └── make.log │   │   └── module │   │   ├── vboxdrv.ko.zst │   │   ├── vboxnetadp.ko.zst │   │   └── vboxnetflt.ko.zst │   └── source -> /usr/src/virtualbox-7.0.10 ├── kernel-6.5.0-10-generic-x86_64 -> 7.0.10/6.5.0-10-generic/x86_64 └── kernel-6.5.0-14-generic-x86_64 -> 7.0.10/6.5.0-14-generic/x86_64

31 directories, 27 files

$ df -h File system Dim. Usati Dispon. Uso% Montato su tmpfs 782M 2,3M 780M 1% /run /dev/sda3 183G 38G 136G 22% / tmpfs 3,9G 76K 3,9G 1% /dev/shm tmpfs 5,0M 8,0K 5,0M 1% /run/lock efivarfs 128K 48K 76K 39% /sys/firmware/efi/efivars /dev/sda4 260G 45G 202G 19% /home /dev/sda1 93M 6,1M 87M 7% /boot/efi tmpfs 782M 80K 782M 1% /run/user/1000

UPDATE 2

Looking at /var/lib/dkms/ch340/1.0.0/build/make.log I found:

/var/lib/dkms/ch340/1.0.0/build/ch340.c: At top level:
/var/lib/dkms/ch340/1.0.0/build/ch340.c:675:30: error: initialization of ‘void (*)(struct tty_struct *, struct usb_serial_port *, const struct ktermios *)’ from incompatible pointer >
  675 |         .set_termios       = ch340_set_termios,
      |                              ^~~~~~~~~~~~~~~~~
/var/lib/dkms/ch340/1.0.0/build/ch340.c:675:30: note: (near initialization for ‘ch340_device.set_termios’)
/var/lib/dkms/ch340/1.0.0/build/ch340.c:676:30: error: initialization of ‘int (*)(struct tty_struct *, int)’ from incompatible pointer type ‘void (*)(struct tty_struct *, int)’ [-Wer>
  676 |         .break_ctl         = ch340_break_ctl,
      |                              ^~~~~~~~~~~~~~~
/var/lib/dkms/ch340/1.0.0/build/ch340.c:676:30: note: (near initialization for ‘ch340_device.break_ctl’)
/var/lib/dkms/ch340/1.0.0/build/ch340.c:682:30: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Wer>
  682 |         .port_remove       = ch340_port_remove,
      |                              ^~~~~~~~~~~~~~~~~
/var/lib/dkms/ch340/1.0.0/build/ch340.c:682:30: note: (near initialization for ‘ch340_device.port_remove’)
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:251: /var/lib/dkms/ch340/1.0.0/build/ch340.o] Errore 1
make[2]: *** [/usr/src/linux-headers-6.5.0-14-generic/Makefile:2037: /var/lib/dkms/ch340/1.0.0/build] Errore 2
make[1]: *** [Makefile:234: __sub-make] Errore 2
make[1]: uscita dalla directory «/usr/src/linux-headers-6.5.0-14-generic»
make: *** [Makefile:5: default] Errore 2

I guess this is the reason why it does not find the binary: it does not build! How is it possible an official Ubuntu application has errors in the code!?

Mark
  • 507

1 Answers1

1

Okay please in file

/usr/src/ch340-1.0.0/dkms.conf

change

AUTOINSTALL="yes"

to

AUTOINSTALL="no"

Then we remove the module from dkms tree.

sudo dkms remove ch340/1.0.0 -k --all

The big question is where comes the folder from.

Please mv folder and only this folder in your $HOME

sudo mv /var/lib/dkms/ch340/ $HOME

Then please

sudo apt -f install

And a sidenote decide for 1 kerneltree.

It seems you use hw-edge at least the modules for virtualbox and nvidia are build and installed for this kerneltree.So clean up linux-generic and linux-generic-hwe-22.04 kernel tree by deinstalling it.

The meta package for this kerneltree is

linux-generic-hwe-22.04-edge

edit:

sudo apt purge linux-generic linux-image-generic linux-headers-generic linux-generic-hwe-22.04 linux-image-generic-hwe-22.04 linux-headers-generic-hwe-22.04

Then please install metapackages for your kernel.

sudo apt install linux-generic-hwe-22.04-edge

And

sudo apt autopurge
nobody
  • 5,437
  • The first part worked well! Just for completeness I could not able to move the /var/lib/dkms/ch340/ since it was not there after removing the module. – Mark Dec 24 '23 at 09:50
  • Would you please clarify how to "decide" and clean up the other kerneltrees? I don't know them and I don't recall I installed three of them! – Mark Dec 24 '23 at 09:50
  • @Mark expand answer. – nobody Dec 24 '23 at 10:03