I somehow messed something up with my Raspbian; it's a fairly new install on a RPi 3B+. When I run sudo apt update and the sudo apt upgrade I get this error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 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 raspberrypi-kernel (1:1.20210831-3~buster) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.10.60+ /boot/kernel.img
run-parts: executing /etc/kernel/postinst.d/dkms 5.10.60+ /boot/kernel.img
dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified.
dkms.conf: Error! No 'PACKAGE_NAME' directive specified.
dkms.conf: Error! No 'PACKAGE_VERSION' directive specified.
Error! Bad conf file.
does not represent a valid dkms.conf file.
run-parts: /etc/kernel/postinst.d/dkms exited with return code 8
dpkg: error processing package raspberrypi-kernel (--configure):
 installed raspberrypi-kernel package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried several solutions from other internet posts but none are working for me (apt clean, apt install -f, dist-upgrade)

Any help is appreciated. Thank you!

  • Wipe the card and reimage it. Oct 1, 2021 at 11:53
  • Your "including but not limited to" is pretty meaningless: it suggests that whatever solution people may post, you have already tried it. Oct 4, 2021 at 10:42

1 Answer 1


Run dkms status to see which dynamic kernel modules you have installed. Then either reinstall those modules if you need them, or remove with

 sudo dkms remove <module>/<ver> --all


 sudo dkms remove anbox-binder/1 --all

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.