I have had issues with my Ubuntu server after it crashed during a release-upgrade. I was upgrading from Ubuntu 18.04 to 20.04 using the do-release-upgrade command. I did a CTRL+C by accident during the process and I had to hard restart the system. The system currently displays 'Ubuntu 20.04' so I guess the upgrade was partially successful.
I managed to recover access to the system via SSH and I'm now trying to fix the issues. Running apt-get upgrades I've noticed that dpkg was throwing errors about the grub-common package:
root@caesarovich:~# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libnginx-mod-http-geoip libunistring2:i386
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 289 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up grub-common (2.04-1ubuntu26.15) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Failed to restart grub-common.service: Unit grub-common.service is not loaded properly: Exec format error.
See system logs and 'systemctl status grub-common.service' for details.
invoke-rc.d: initscript grub-common, action "restart" failed.
● grub-common.service - Record successful boot for GRUB
Loaded: error (Reason: Exec format error)
Active: inactive (dead)
Apr 07 14:35:20 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:40:57 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:40:57 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:40:58 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:41:18 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:41:18 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:41:18 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:50:28 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:50:29 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
Apr 07 14:50:29 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
dpkg: error processing package grub-common (--configure):
installed grub-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of grub-efi:
grub-efi depends on grub-common (= 2.04-1ubuntu26.15); however:
Package grub-common is not configured yet.
dpkg: error processing package grub-efi (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-efi-amd64-bin:
grub-efi-amd64-bin depends on grub-common (>= 2.02~beta2-9); however:
Package grub-common is not configured yet.
dpkg: error processing package grub-efi-amd64-bin (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-efi-amd64:
grub-efi-amd64 depends on grub-efi-amd64-bin (= 2.04-1ubuntu44.2); however:
Package grub-efi-amd64-bin is not configured yet.
dpkg: error processing package grub-efi-amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub2-common:
grub2-common depends on grub-common (= 2.04-1ubuntu26.15); however:
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
Package grub-common is not configured yet.
dpkg: error processing package grub2-common (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
grub-efi-amd64-signed depends on grub-efi-amd64-bin (= 2.04-1ubuntu44.2); however:
Package grub-efi-amd64-bin is not configured yet.
grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
Package grub-efi-amd64 is not configured yet.
Package grub-pc is not installed.
grub-efi-amd64-signed depends on grub2-common (>= 2.02~beta2-36ubuntu3.31); however:
Package grub2-common is not configured yet.
dpkg: error processing package grub-efi-amd64-signed (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
grub-common
grub-efi
grub-efi-amd64-bin
grub-efi-amd64
grub2-common
grub-efi-amd64-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)
The line that caught my eyes is this one:
Apr 07 14:40:57 caesarovich.xyz systemd[1]: /lib/systemd/system/grub-common.service:10: Executable path is not absolute: grub-editenv /boot/grub/grubenv unset recordfail
But I don't find anything about this error on the web. I wonder if anyone knows what it is about. Any hint might be welcome !
Edit: Here's additional information requested
~# cat /lib/systemd/system/grub-common.service
[Unit]
Description=Record successful boot for GRUB
After=sleep.target
ConditionPathExists=/boot/grub/grub.cfg
[Service]
Type=oneshot
Restart=no
ExecStartPre=/bin/sh -c '[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub'
ExecStart=grub-editenv /boot/grub/grubenv unset recordfail
ExecStartPost=/bin/sh -c 'if grub-editenv /boot/grub/grubenv list | grep -q initrdless_boot_fallback_triggered=1; then echo "grub: GRUB_FORCE_PARTUUID set, initrdless boot paniced, fallback triggered."; fi'
StandardOutput=kmsg
[Install]
WantedBy=multi-user.target sleep.target
command: file /usr/bin/grub-editenv
/usr/bin/grub-editenv: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e9970f097fb3d25735e9607c0cb1da91505f8f92, for GNU/Linux 3.2.0, stripped
[SOLVED]
I did not have many time lately to get over the issue but today i came back with a fresh mind, and managed to solve the issue.
The problem was that in grub-common.service the ExecStart was not absolute. FIX: Edit the .service file and make the path absolute ExecStart=/usr/bin/grub-editenv
instead of ExecStart=grub-editenv
.
cat /lib/systemd/system/grub-common.service
– nobody Apr 07 '22 at 13:28file /usr/bin/grub-editenv
. Also what is your machine architecture (uname -m
). – steeldriver Apr 07 '22 at 15:04uname -m
and (b) whether you have any other executables namedgrub-editenv
anywhere in/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
(usingtype -a grub-editenv
and/orwhich grub-editenv
for example) – steeldriver Apr 09 '22 at 18:59