1

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.

Tofandel
  • 105
  • Hello. What were you upgrading? What OS to what OS? – David Apr 07 '22 at 13:02
  • Hi, I upgraded from Ubuntu 18.04 to 20.04. I used the do-release-upgrade command. And I pressed CTRL+C at somepoint by accident. Currently my system is on 20.04, so I guess the upgrade was partially successful. – Caesarovich Apr 07 '22 at 13:05
  • Please add this info to the original question via edit. Others will argue and say I am wrong that with a long effort you MAY get it working again but my suggestion is a fresh install. Systems like this are often never 100 percent good any other way. – David Apr 07 '22 at 13:07
  • Please [edit] your question and show us cat /lib/systemd/system/grub-common.service – nobody Apr 07 '22 at 13:28
  • "Package grub-common is not configured yet" This is your problem. Unfortunately I'm not very good with grub. Maybe a simple reinstall will suffice? – s1mmel Apr 07 '22 at 13:52
  • I've added the requested informations – Caesarovich Apr 07 '22 at 14:11
  • Did you check what the actual exec format of the file is? ex. file /usr/bin/grub-editenv . Also what is your machine architecture (uname -m). – steeldriver Apr 07 '22 at 15:04
  • @steeldriver I've added the result of your command. Sorry for late reply – Caesarovich Apr 09 '22 at 18:08
  • @Caesarovich thanks - can you confirm (a) output of uname -m and (b) whether you have any other executables named grub-editenv anywhere in /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin (using type -a grub-editenv and/or which grub-editenv for example) – steeldriver Apr 09 '22 at 18:59
  • You should really have answered your question instead of editing. Also in your file there is no "ExecPath" so what are we supposed to take from this? What is the real solution – Tofandel Nov 09 '22 at 11:10

0 Answers0