PDA

View Full Version : Kali Sudo Apt upgrade throwing Linuc header error



ci9her
2023-01-05, 16:22
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)

anons9
2023-01-10, 18:24
Hey. I got the same issue, and my Ubuntu, Win10, and Kali (on the same laptop) system run slow after upgrade. I do not know if Kali change something on BIOS?

saurel
2023-01-11, 06:26
Same situation on my Kali since APX 2 weeks now. Tried couple of things but no effect at all... I can always reinstal the OS but that's the final solution. Hope someone figure it out.

kalicoolkid
2023-01-15, 19:31
I'm getting similar errors on my Kali VM (VMware Workstation 17 Pro). When I reboot the VM it fails to boot with an error message of CPU disabled by guest OS. My other dedicated Kali laptop is fine.

Some info after trying "sudo apt --fix-broken install "

__________________________________________________ _______
sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
catfish dh-elpa-helper faraday-client gir1.2-xfconf-0 libarmadillo10 libatk1.0-data libavfilter7 libavformat58 libcfitsio9 libcharls2 libev4 libexporter-tiny-perl libflac8 libfmt8
libgdal30 libgdal31 libgeos3.10.2 libgeos3.11.0 libgs9-common libgssdp-1.2-0 libgupnp-1.2-1 libgvm21 libilmbase25 liblist-moreutils-perl liblist-moreutils-xs-perl libopenexr25
libopenh264-6 libperl5.34 libplacebo192 libpoppler118 libpostproc55 libprotobuf23 libsrt1.4-gnutls libswscale5 libwebsockets16 libwireshark15 libwiretap12 libwsutil13 libzxingcore1
linux-headers-5.16.0-kali7-amd64 linux-headers-5.16.0-kali7-common linux-headers-5.18.0-kali5-amd64 linux-headers-5.18.0-kali5-common linux-image-5.16.0-kali7-amd64
linux-image-5.18.0-kali5-amd64 linux-kbuild-5.16 lua-bitop lua-cjson openjdk-11-jre perl-modules-5.34 python-pastedeploy-tpl python3-dataclasses-json python3-deprecation
python3-limiter python3-marshmallow-enum python3-mypy-extensions python3-ntlm-auth python3-requests-ntlm python3-responses python3-spyse python3-token-bucket python3-toml
python3-typing-inspect ruby3.0 ruby3.0-dev ruby3.0-doc
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 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 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

Building module:
Cleaning build area...
'make' -j4 KVER=6.0.0-kali6-amd64 KSRC=/lib/modules/6.0.0-kali6-amd64/build......(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.0.0-kali6-amd64 (x86_64)
Consult /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/make.log for more information.
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-headers-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 subprocess 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 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

Building module:
Cleaning build area...
'make' -j4 KVER=6.0.0-kali6-amd64 KSRC=/lib/modules/6.0.0-kali6-amd64/build......(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.0.0-kali6-amd64 (x86_64)
Consult /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/make.log for more information.
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 subprocess 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); however:
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)


Still trying to figure this out. I'm wondering if I need to delete / purge the DKMS and reinstall later?

kalicoolkid
2023-01-16, 20:01
I was able to get my Kali VM working again. To recap my issue, on my first pass of update / upgrade I got the error

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)

When I rebooted the VM it would not come up. I got the error message "CPU disabled by guest OS". So I deleted that VM and copied over my backup. I thought maybe it was a fluke. So I did all the same things again and got the same result....lol

So deleted that VM and again copied over my back up. This time after the update / upgrade, I ran "sudo apt --fix-broken install" and it looks like the issue for me was around dkms/8812au

Error! Bad return status for module build on kernel: 6.0.0-kali6-amd64 (x86_64)
Consult /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/make.log for more information.

I looked through the make.log file but could not make much sense of it.

I'm not 100% sure what fixed it but these are some of the steps I took (looking through my terminal history)

sudo dkms uninstall rtl8812au/5.6.4.2_35491.20191025 (I don't think the uninstall worked)

sudo apt purge rtl8812au/5.6.4.2_35491.20191025

sudo apt-get remove dkms

sudo apt --fix-broken install

sudo apt autoremove

sudo apt-get update

sudo apt-get upgrade

sudo apt install linux-headers-6.0.0-kali6-amd64

I then shutdown and restarted the VM and it came up fine. I then had to reinstall dkms and the 8812xx driver for my ALFA AWUS036ACH

I followed this video to get that working again - https://www.***********************TZ2nYEYxkHo

I was on a VM that I had a backup of so I was trying all sorts of stuff. I'm not really sure what fixed the issue.

chrisribas
2023-02-09, 10:38
thank you - it worked for me too

I was able to get my Kali VM working again. To recap my issue, on my first pass of update / upgrade I got the error

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)

When I rebooted the VM it would not come up. I got the error message "CPU disabled by guest OS". So I deleted that VM and copied over my backup. I thought maybe it was a fluke. So I did all the same things again and got the same result....lol

So deleted that VM and again copied over my back up. This time after the update / upgrade, I ran "sudo apt --fix-broken install" and it looks like the issue for me was around dkms/8812au

Error! Bad return status for module build on kernel: 6.0.0-kali6-amd64 (x86_64)
Consult /var/lib/dkms/8812au/5.6.4.2_35491.20191025/build/make.log for more information.

I looked through the make.log file but could not make much sense of it.

I'm not 100% sure what fixed it but these are some of the steps I took (looking through my terminal history)

sudo dkms uninstall rtl8812au/5.6.4.2_35491.20191025 (I don't think the uninstall worked)

sudo apt purge rtl8812au/5.6.4.2_35491.20191025

sudo apt-get remove dkms

sudo apt --fix-broken install

sudo apt autoremove

sudo apt-get update

sudo apt-get upgrade

sudo apt install linux-headers-6.0.0-kali6-amd64

I then shutdown and restarted the VM and it came up fine. I then had to reinstall dkms and the 8812xx driver for my ALFA AWUS036ACH

I followed this video to get that working again - https://www.***********************TZ2nYEYxkHo

I was on a VM that I had a backup of so I was trying all sorts of stuff. I'm not really sure what fixed the issue.