0

On a brand new server I am trying to run the update and upgrade but I get 2 packages popping out an error.

Specifically:

~ # apt update && apt -y upgrade && apt -y install curl wget sudo
Hit:1 http://mirror.hetzner.com/ubuntu/packages jammy InRelease
Hit:2 http://mirror.hetzner.com/ubuntu/packages jammy-updates InRelease
Hit:3 http://mirror.hetzner.com/ubuntu/packages jammy-backports InRelease
Hit:4 http://mirror.hetzner.com/ubuntu/packages jammy-security InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://de.archive.ubuntu.com/ubuntu jammy InRelease
Get:7 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:8 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Fetched 214 kB in 0s (442 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps tease /r/Linux ;)
# Use 'pro config set apt_news=false' to hide this and future APT news.
#
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up grub-efi-amd64-signed (1.182~22.04.1+2.06-2ubuntu10) ...
mount: /var/lib/grub/esp: special device /dev/sda15 does not exist.
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 32
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed | grub-efi-arm64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-efi-amd64-signed
 shim-signed
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Found several solutions both here and on stack exchange that suggest to run the following:

sudo apt-get purge grub\*
sudo apt-get install grub-efi
sudo apt-get autoremove
sudo update-grub

But running just the first line I get the following:

~ # sudo apt-get purge grub\*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'grub-rescue-pc' for glob 'grub*'
Note, selecting 'grub-xen' for glob 'grub*'
Note, selecting 'grub2' for glob 'grub*'
Note, selecting 'grub-splashimages' for glob 'grub*'
Note, selecting 'grubzfs-testsuite' for glob 'grub*'
Note, selecting 'grub-coreboot' for glob 'grub*'
Note, selecting 'grub-legacy-doc' for glob 'grub*'
Note, selecting 'grub-legacy-ec2' for glob 'grub*'
Note, selecting 'grub-emu-dbg' for glob 'grub*'
Note, selecting 'grub-pc-bin' for glob 'grub*'
Note, selecting 'grub-pc-dbg' for glob 'grub*'
Note, selecting 'grub-gfxpayload-lists' for glob 'grub*'
Note, selecting 'grub-xen-host' for glob 'grub*'
Note, selecting 'grub2-themes-ubuntustudio' for glob 'grub*'
Note, selecting 'grub-ieee1275-bin' for glob 'grub*'
Note, selecting 'grub-cloud-amd64' for glob 'grub*'
Note, selecting 'grub-ieee1275-dbg' for glob 'grub*'
Note, selecting 'grub-imageboot' for glob 'grub*'
Note, selecting 'grub-efi-arm64' for glob 'grub*'
Note, selecting 'grub-efi-amd64' for glob 'grub*'
Note, selecting 'grub-efi-arm' for glob 'grub*'
Note, selecting 'grub-yeeloong' for glob 'grub*'
Note, selecting 'grub' for glob 'grub*'
Note, selecting 'grub-ipxe' for glob 'grub*'
Note, selecting 'grub-firmware-qemu' for glob 'grub*'
Note, selecting 'grub-efi-amd64-signed' for glob 'grub*'
Note, selecting 'grub-coreboot-bin' for glob 'grub*'
Note, selecting 'grub-efi-arm64-signed' for glob 'grub*'
Note, selecting 'grub-coreboot-dbg' for glob 'grub*'
Note, selecting 'grub-theme-starfield' for glob 'grub*'
Note, selecting 'grub-efi-amd64-bin' for glob 'grub*'
Note, selecting 'grub2-common' for glob 'grub*'
Note, selecting 'grub-legacy' for glob 'grub*'
Note, selecting 'grub-efi-amd64-signed-template' for glob 'grub*'
Note, selecting 'grub-efi-amd64-dbg' for glob 'grub*'
Note, selecting 'grub-ieee1275' for glob 'grub*'
Note, selecting 'grub-uboot' for glob 'grub*'
Note, selecting 'grub-common' for glob 'grub*'
Note, selecting 'grub2-splashimages' for glob 'grub*'
Note, selecting 'grub-efi-ia32-bin' for glob 'grub*'
Note, selecting 'grub-efi-ia32-dbg' for glob 'grub*'
Note, selecting 'grub2-themes-ubuntu-mate' for glob 'grub*'
Note, selecting 'grub-invaders' for glob 'grub*'
Note, selecting 'grub-linuxbios' for glob 'grub*'
Note, selecting 'grub-xen-bin' for glob 'grub*'
Note, selecting 'grub-efi-ia32' for glob 'grub*'
Note, selecting 'grub-efi-ia64' for glob 'grub*'
Note, selecting 'grub-xen-dbg' for glob 'grub*'
Note, selecting 'grub-pc' for glob 'grub*'
Note, selecting 'grub-doc' for glob 'grub*'
Note, selecting 'grub-efi' for glob 'grub*'
Note, selecting 'grub-emu' for glob 'grub*'
Note, selecting 'grub-theme-breeze' for glob 'grub*'
Package 'grub-efi-ia64' is not installed, so not removed
Package 'grub-yeeloong' is not installed, so not removed
Package 'grub' is not installed, so not removed
Package 'grub-legacy' is not installed, so not removed
Package 'grub-legacy-doc' is not installed, so not removed
Package 'grub-cloud-amd64' is not installed, so not removed
Package 'grub-doc' is not installed, so not removed
Package 'grub-efi-arm' is not installed, so not removed
Package 'grub-efi-arm64' is not installed, so not removed
Package 'grub-uboot' is not installed, so not removed
Package 'grub-efi-arm64-signed' is not installed, so not removed
Package 'grub-efi' is not installed, so not removed
Package 'grub-efi-ia32' is not installed, so not removed
Package 'grub-efi-ia32-bin' is not installed, so not removed
Package 'grub-efi-ia32-dbg' is not installed, so not removed
Package 'grub-ieee1275' is not installed, so not removed
Package 'grub-ieee1275-bin' is not installed, so not removed
Package 'grub-ieee1275-dbg' is not installed, so not removed
Package 'grub-ipxe' is not installed, so not removed
Package 'grub-legacy-ec2' is not installed, so not removed
Package 'grub-pc-dbg' is not installed, so not removed
Package 'grub-xen' is not installed, so not removed
Package 'grub-xen-bin' is not installed, so not removed
Package 'grub-xen-dbg' is not installed, so not removed
Package 'grub-coreboot' is not installed, so not removed
Package 'grub-coreboot-bin' is not installed, so not removed
Package 'grub-coreboot-dbg' is not installed, so not removed
Package 'grub-efi-amd64-signed-template' is not installed, so not removed
Package 'grub-emu' is not installed, so not removed
Package 'grub-emu-dbg' is not installed, so not removed
Package 'grub-firmware-qemu' is not installed, so not removed
Package 'grub-imageboot' is not installed, so not removed
Package 'grub-invaders' is not installed, so not removed
Package 'grub-linuxbios' is not installed, so not removed
Package 'grub-rescue-pc' is not installed, so not removed
Package 'grub-splashimages' is not installed, so not removed
Package 'grub-theme-breeze' is not installed, so not removed
Package 'grub-theme-starfield' is not installed, so not removed
Package 'grub-xen-host' is not installed, so not removed
Package 'grub2' is not installed, so not removed
Package 'grub2-splashimages' is not installed, so not removed
Package 'grub2-themes-ubuntu-mate' is not installed, so not removed
Package 'grub2-themes-ubuntustudio' is not installed, so not removed
Package 'grubzfs-testsuite' is not installed, so not removed
Package 'grub-efi-amd64-dbg' is not installed, so not removed
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 shim-signed : Depends: grub-efi-amd64-signed but it is not going to be installed or
                        grub-efi-arm64-signed but it is not installable
               Depends: grub2-common (>= 2.04-1ubuntu24) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I even tried to run the rest of the commands but nothing really changed. I am stuck with this annoying error.

Tried removing shim-signed so that I can remove grub and reinstall it:

 ~ # apt remove grub-efi-amd64-signed shim-signed -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  grub-efi-amd64-signed shim-signed
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  shim-signed grub-efi-amd64-signed (due to shim-signed)
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 8,603 kB disk space will be freed.
E: Removing essential system-critical packages is not permitted. This might break the system.

tried to configure dpkg:

 ~ # sudo dpkg --configure -a
Setting up grub-efi-amd64-signed (1.182~22.04.1+2.06-2ubuntu10) ...
mount: /var/lib/grub/esp: special device /dev/sda15 does not exist.
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 32
dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed | grub-efi-arm64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-efi-amd64-signed
 shim-signed

All this is on a bare metal server hosted in Hetzner.

update: @Organic Marble Offered to help (thanks) and asked for the efi flags of the ssds. Upon suggestion I used parted -l Here is the result:

Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  34.4GB  34.4GB  primary               raid
 2      34.4GB  35.4GB  1074MB  primary               raid
 3      35.4GB  512GB   477GB   primary               raid


Model: Linux Software RAID Array (md)
Disk /dev/md2: 477GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End    Size   File system  Flags
 1      0.00B  477GB  477GB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md0: 34.3GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system     Flags
 1      0.00B  34.3GB  34.3GB  linux-swap(v1)


Model: SAMSUNG MZVL2512HCJQ-00B00 (nvme)
Disk /dev/nvme1n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  34.4GB  34.4GB  primary               raid
 2      34.4GB  35.4GB  1074MB  primary               raid
 3      35.4GB  512GB   477GB   primary               raid


Model: Linux Software RAID Array (md)
Disk /dev/md1: 1072MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  1072MB  1072MB  ext3
5
  • What flag(s) are set on the EFI partition? Use gnome-disks or gparted to find out. Nov 8, 2022 at 12:45
  • I said that It is on a server hosted over on Hetzner. It's terminal only. How am I going to install gparted or gnome-disks. I do not have gnome.
    – escozul
    Nov 8, 2022 at 18:34
  • 1
    sudo parted -l will show the partition flags Nov 9, 2022 at 3:14
  • Thanks. I added the result of that on the original question. (Flags are... "raid"?). Don't really know how to use that info so I appreciate your help with it.
    – escozul
    Nov 9, 2022 at 15:33
  • 1
    Sorry, I don't know RAID so I can't be much help. I had a similar error last month, and it turned out to be because the EFI partition was missing the boot & esp flags. But in your setup I can't even find the EFI partition. Nov 9, 2022 at 15:49

1 Answer 1

3

I've also had the same problem on a bare metal server hosted in Hetzner.

My server setup is custom (added 2 additional SSDs)

My partitioning setup is also custom. I've merged capacity of all drives using LVM.

My solution was to edit /var/cache/debconf/config.dat manually and to find the location in the file where the old patition names is cached of which no longer available and delete each block. (delete entire paragraphs separated by blank lines)

List of blocks I had deleted:

Name: grub-efi/install_devices
Template: grub-efi/install_devices
Value: /dev/sda15
Owners: grub-common, grub-efi-amd64, grub-pc
Flags: seen
Variables:
 CHOICES = /dev/sda2 (268 MB; /boot/efi) on 4194 MB QEMU_HARDDISK
 RAW_CHOICES = /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive0-part2

Name: grub-efi/install_devices_disks_changed
Template: grub-efi/install_devices_disks_changed
Value: /dev/sda15
Owners: grub-common, grub-efi-amd64
Flags: seen
Variables:
 CHOICES = 
 RAW_CHOICES = 

Name: grub-efi/partition_description
Template: grub-efi/partition_description
Owners: grub-common, grub-efi-amd64
Variables:
 DEVICE = /dev/sda2
 DISK_MODEL = QEMU_HARDDISK
 DISK_SIZE = 4194
 PATH = /boot/efi
 SIZE = 268

Then I've run the following command (Select yes in case confirmation for continuing without grub setup)

sudo apt install -f 

And finally:

update-grub

It fixed the problem for me. Looks like it's related to Hetzner installer script and the cache it creates during installation and changes to logical drive mapping added by me after installation.

3
  • I'm not familiar with this particular file. What effect does deleting those entries might have? I mean it's in the cache folder. Does it regenerate automatically?
    – escozul
    Nov 17, 2022 at 14:06
  • @escozul No, it doesn't. Better not to do it as it could break other packages when updating them. Dec 4, 2022 at 13:08
  • ΑAnddd.... Back to square 1. Actually That's the second time I've encountered this error. Last time I was able to remove all conflicting packages (including grub) and reinstall them and it worked... but it's not working this time. I really think I'm missing some step at this point.
    – escozul
    Dec 5, 2022 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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