I'm using Ubuntu 20.04.3 LTS x86_64 and I've been trying to install the newest version of the kernel using:
sudo apt update && sudo apt upgrade
But by the end of the run it always shows the following message:
Adding boot menu entry for UEFI Firmware Settings
/etc/grub.d/35_fwupd: line 5: /usr/share/grub: Is a directory
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 126
dpkg: error processing package linux-image-5.4.0-84-generic (--configure):
installed linux-image-5.4.0-84-generic package post-installation script subprocess returned error exit st
atus 1
Errors were encountered while processing:
linux-image-5.4.0-84-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
The output of uname -r
is:
5.4.0-81-generic.
That means that the kernel isn't correctly installed.
Does anybody have an idea of what's going on?
Edit:
By request I'm posting the content of my /etc/grub.d/35_fwupd
file:
#! /bin/bash
# SPDX-License-Identifier: LGPL-2.1+
set -e
${pkgdatadir:?}
# shellcheck source=/dev/null
. "$pkgdatadir/grub-mkconfig_lib"
if [ -f /var/lib/fwupd/uefi_capsule.conf ] &&
ls /sys/firmware/efi/efivars/fwupd-*-0abba7dc-e516-4167-bbf5-4d9d1c739416 1>/dev/null 2>&1; then
source /var/lib/fwupd/uefi_capsule.conf
if [ "${EFI_PATH}" != "" ] && [ "${ESP}" != "" ]; then
echo "Adding Linux Firmware Updater entry" >&2
cat << EOF
menuentry 'Linux Firmware Updater' \$menuentry_id_option 'fwupd' {
EOF
${grub_probe:?}
prepare_grub_to_access_device '`${grub_probe} --target=device \${ESP}` | sed -e "s/^/\t/"'
cat << EOF
chainloader ${EFI_PATH}
}
EOF
fi
fi