I was having a similar error with dpkg as follows --
In my case my grub configuration was erroring - I had added zswap to the system, and added the line "
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
zswap.enabled=1"
My mistake, the correct method to add the line is " GRUB_CMDLINE_LINUX_DEFAULT="quiet splash zswap.enabled=1"
After changing the grub file (sudo gedit grub), then running "sudo update-grub", my update and upgrade errors from dpkg vanished. I haven't rebooted yet, that is next!
sudo dpkg --configure -a
Setting up linux-image-6.2.0-35-generic (6.2.0-35.35~22.04.1) ...
Processing triggers for linux-image-6.2.0-35-generic (6.2.0-35.35~22.04.1) ...
/etc/kernel/postinst.d/dkms:
* dkms: autoinstall for dkms modules has been disabled
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.2.0-35-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 12: /etc/default/grub: zswap.enabled=1: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-6.2.0-35-generic (--configure):
installed linux-image-6.2.0-35-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-6.2.0-35-generic
I was having a similar error with dpkg as follows --
In my case my grub configuration was erroring - I had added zswap to the system, and added the line " LINUX_DEFAULT= "quiet splash"
GRUB_CMDLINE_
zswap.enabled=1"
My mistake, the correct method to add the line is " GRUB_CMDLINE_ LINUX_DEFAULT= "quiet splash zswap.enabled=1"
After changing the grub file (sudo gedit grub), then running "sudo update-grub", my update and upgrade errors from dpkg vanished. I haven't rebooted yet, that is next!
sudo dpkg --configure -a 6.2.0-35- generic (6.2.0- 35.35~22. 04.1) ... 6.2.0-35- generic (6.2.0- 35.35~22. 04.1) ... postinst. d/dkms: postinst. d/initramfs- tools: img-6.2. 0-35-generic postinst. d/zz-update- grub: grub-mkconfig: 12: /etc/default/grub: zswap.enabled=1: not found postinst. d/zz-update- grub exited with return code 127 6.2.0-35- generic (--configure): 6.2.0-35- generic package post-installation script subprocess returned error exit status 1 image-6. 2.0-35- generic
Setting up linux-image-
Processing triggers for linux-image-
/etc/kernel/
* dkms: autoinstall for dkms modules has been disabled
/etc/kernel/
update-initramfs: Generating /boot/initrd.
/etc/kernel/
Sourcing file `/etc/default/grub'
/usr/sbin/
run-parts: /etc/kernel/
dpkg: error processing package linux-image-
installed linux-image-
Errors were encountered while processing:
linux-