Hi All,

I am unable to update kali. Every time I try to terminal throws Linux Header error.
I am posting the error here. Please let me know if anyone has solutions.



└─$ sudo apt -y upgrade 1 ⨯
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libcfitsio9 libgnuradio-analog3.10.4 libgnuradio-channels3.10.4
libgnuradio-digital3.10.4 libgnuradio-dtv3.10.4 libgnuradio-fec3.10.4
libgnuradio-fft3.10.4 libgnuradio-filter3.10.4 libgnuradio-iio3.10.4
libgnuradio-network3.10.4 libgnuradio-pdu3.10.4 libgnuradio-qtgui3.10.4
libgnuradio-soapy3.10.4 libgnuradio-trellis3.10.4
libgnuradio-video-sdl3.10.4 libgnuradio-vocoder3.10.4
libgnuradio-wavelet3.10.4 libgnuradio-zeromq3.10.4 libprotobuf23
Use 'sudo apt autoremove' to remove them.
The following packages have been kept back:
dhcpcd-base
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-headers-6.0.0-kali6-amd64 (6.0.12-1kali1) ...
/etc/kernel/header_postinst.d/dkms:
dkms: running auto installation service for kernel 6.0.0-kali6-amd64:Sign comman
d: /usr/lib/linux-kbuild-6.0/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The /var/lib/dkms/aufs/5.2+20190909/6.0.0-kali6-amd64/x86_64/dkms.conf fo
r module aufs includes a BUILD_EXCLUSIVE directive which does not match this ker
nel/arch/config.
This indicates that it should not be built.
Sign command: /usr/lib/linux-kbuild-6.0/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The /var/lib/dkms/wireguard/1.0.20210219/6.0.0-kali6-amd64/x86_64/dkms.co
nf for module wireguard includes a BUILD_EXCLUSIVE directive which does not matc
h this kernel/arch/config.
This indicates that it should not be built.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
failed!
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11
Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-head
ers-6.0.0-kali6-amd64.postinst line 11.
dpkg: error processing package linux-headers-6.0.0-kali6-amd64 (--configure):
installed linux-headers-6.0.0-kali6-amd64 package post-installation script subp
rocess returned error exit status 1
Setting up linux-image-6.0.0-kali6-amd64 (6.0.12-1kali1) ...
/etc/kernel/postinst.d/dkms:
dkms: running auto installation service for kernel 6.0.0-kali6-amd64:Sign comman
d: /usr/lib/linux-kbuild-6.0/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The /var/lib/dkms/aufs/5.2+20190909/6.0.0-kali6-amd64/x86_64/dkms.conf fo
r module aufs includes a BUILD_EXCLUSIVE directive which does not match this ker
nel/arch/config.
This indicates that it should not be built.
Sign command: /usr/lib/linux-kbuild-6.0/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Error! The /var/lib/dkms/wireguard/1.0.20210219/6.0.0-kali6-amd64/x86_64/dkms.co
nf for module wireguard includes a BUILD_EXCLUSIVE directive which does not matc
h this kernel/arch/config.
This indicates that it should not be built.
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.
failed!
run-parts: /etc/kernel/postinst.d/dkms exited with return code 11
dpkg: error processing package linux-image-6.0.0-kali6-amd64 (--configure):
installed linux-image-6.0.0-kali6-amd64 package post-installation script subpro
cess returned error exit status 1
dpkg: dependency problems prevent configuration of linux-headers-amd64:
linux-headers-amd64 depends on linux-headers-6.0.0-kali6-amd64 (= 6.0.12-1kali1
); however:
Package linux-headers-6.0.0-kali6-amd64 is not configured yet.


dpkg: error processing package linux-headers-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-amd64:
linux-image-amd64 depends on linux-image-6.0.0-kali6-amd64 (= 6.0.12-1kali1); h
owever:
Package linux-image-6.0.0-kali6-amd64 is not configured yet.


dpkg: error processing package linux-image-amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-headers-6.0.0-kali6-amd64
linux-image-6.0.0-kali6-amd64
linux-headers-amd64
linux-image-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)