업데이트를 처리하는 중 오류가 발생했습니다.

업데이트를 처리하는 중 오류가 발생했습니다.

새로운 서버에서 업데이트와 업그레이드를 실행하려고 하는데 2개의 패키지에서 오류가 발생합니다.

구체적으로:

~ # 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)

여기와 스택 교환에서 다음을 실행하도록 제안하는 몇 가지 솔루션을 찾았습니다.

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

그러나 첫 번째 줄만 실행하면 다음과 같은 결과가 나타납니다.

~ # 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.

나머지 명령도 실행해 보았지만 실제로는 아무것도 바뀌지 않았습니다. 이 성가신 오류가 발생했습니다.

grub을 제거하고 다시 설치할 수 있도록 shim 서명을 제거해 보았습니다.

 ~ # 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.

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

이 모든 것은 Hetzner에서 호스팅되는 베어메탈 서버에 있습니다.

업데이트: @Organic Marble 도움을 주겠다고 제안하고(감사합니다) SSD의 efi 플래그를 요청했습니다. 제안에 따라 내가 사용한 parted -l 결과는 다음과 같습니다.

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

답변1

Hetzner에서 호스팅되는 베어메탈 서버에서도 동일한 문제가 발생했습니다.

내 서버 설정은 사용자 지정입니다(추가 SSD 2개 추가).

내 파티셔닝 설정도 사용자 정의입니다. LVM을 사용하여 모든 드라이브의 용량을 병합했습니다.

내 해결책은 /var/cache/debconf/config.dat를 수동으로 편집하고 파일에서 더 이상 사용할 수 없는 이전 파티션 이름이 캐시된 위치를 찾아 각 블록을 삭제하는 것이었습니다. (빈 줄로 구분된 전체 단락 삭제)

내가 삭제한 블록 목록:

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

그런 다음 다음 명령을 실행했습니다. (grub 설정 없이 계속하려면 예를 선택하세요.)

sudo apt install -f 

그리고 마지막으로:

update-grub

문제가 해결되었습니다. Hetzner 설치 프로그램 스크립트 및 설치 중에 생성되는 캐시 및 설치 후 내가 추가한 논리 드라이브 매핑에 대한 변경 사항과 관련된 것 같습니다.

관련 정보