Score:1

Why is my system not installing newest kernel (linux-image-5.4.0-84-generic)?

uz flag

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
user535733 avatar
cn flag
Your output strongly suggests a problem with line 5 of `/etc/grub.d/35_fwupd`
O.Cuenca avatar
uz flag
Excuse me @user535733 , but I don't get the issue. Could you explain?
user535733 avatar
cn flag
Post the contents of the file (at least the first 10 lines) in your question.
O.Cuenca avatar
uz flag
There is the full file as requested
Ahmed avatar
us flag
Try to remove that file `mv -v /etc/grub.d/35_fwupd ~/` and upgrade, maybe that will help
cc flag
That file is not a part of Ubuntu 20.04 from apt-file search. Maybe a leftover from an upgrade from a previous release?
O.Cuenca avatar
uz flag
Just tried removing the file and works perfectly just like Ahmed said. ubfan1 it could be, I upgraded from Ubuntu 18.04 LTS like a couple of months ago, but it is sorta weird it just caused problems now.
Score:1
uz flag

According to the user Ahmed & ubfan1, the file /etc/grub.d/35_fwupd isn't part of the Ubuntu apt-file search, and could be a leftover from an upgrade I had recently from Ubuntu 18.04 LTS.

After deleting that file and trying to upgrade again the error message was gone and the output of uname -r now displays:

5.4.0-84-generic

After that I went through a couple of reboots to see if there would be any problems, but nothing so far.

Score:1
cn flag

I had the same issue and answered it here

tl;dr

The upstream developers of fwupd fixed this bug like this, i.e. they replaced the ${pkgdatadir:?} line with [ -d ${pkgdatadir:?} ]

Apparently they are the one who reported that bug, so they are aware of it and they have already fixed their package for hirsute, just not the one for focal.

O.Cuenca avatar
uz flag
Thank you for your answer While my system was working fine without the file, I'm going to use your solution instead as it seems less risky than deleting a file all together. I rebooted to see if everything was normal, and it was. So unless something breaks, I think you nailed it.
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.