Score:1

I am getting the Error code of "E: Sub-process /usr/bin/dpkg returned an error code (1)"

in flag
sudo apt-get upgrade

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 linux-image-unsigned-5.11.0-27-generic (5.11.0-27.29~20.04.1) ...
Processing triggers for linux-image-unsigned-5.11.0-27-generic (5.11.0-27.29~20.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.11.0-27-generic
I: The initramfs will attempt to resume from /dev/sda6
I: (UUID=09a8cb63-4799-48d8-b068-76df583caf88)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 1: /etc/default/grub: If: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-unsigned-5.11.0-27-generic (--configure):
 installed linux-image-unsigned-5.11.0-27-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-unsigned-5.11.0-27-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
user535733 avatar
cn flag
Your output suggests that you have made a typo and removed the first character of line 1 of `/etc/default/grub`. The first character of line 1 is supposed to be a comment mark (`#`) so the rest of the line is treated as a comment. Open a text editor and restore the missing character. Then try again.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.