Score:-1

Server 18.04 won't boot, likely bad package upgrade

ar flag
jtd

Summary: update-initramfs fails, can't reinstall it, can't boot server

Details: Ubuntu Server 18.04 LTS ends up with something like this from Ubuntu server crashes on boot "end trace 3b4c21cd8473b17e".

I can use a 16.04.2 .iso to offer me "Rescue a broken system" in a simple GUI:

  • Network configuration succeeds
    • I can see it succeeding with "IPv6" and "DHCP" stuff although I don't know the commands it's running
  • it recognizes the encrypted volume at /dev/sdb5 and lets me open it
  • then lets me use /dev/ubuntuserver-vg/root as the root file system
  • recognizes separate /boot partition and lets me mount it
  • "grub-install /dev/sdb1 failed" if I try "Reinstall GRUB boot loader"
    • fdisk -l puts boot flag on /dev/sdb1
  • lets me execute a shell with installer environment with /dev/ubuntuserver-vg/root mounted on /target
  • chroot /target works
  • df -h | grep boot says 236M 96M 128M 43% /boot
  • apt list --installed | grep linux-image says linux-image-4.15.0-66-generic/bionic-updates,bionic-security,now 4.15.0-66.75 amd64 [installed]

If I try apt upgrade --fix-missing I get

Processing triggers for initramfs-tools (0.130ubuntu3.13) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-66-generic
/usr/sbin/mkinitramfs: 1: /usr/sbin/mkinitramfs: getopt: not found
W: non-GNU getopt
update-initramfs: failed for /boot/initrd.img-4.15.0-66-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools

Edit 1:

  • Thanks to @Rega, I interpreted the messages as missing commands, looked on another Ubuntu system for the package that supplied that command with dpkg -S <command> and then reinstalled that package and tried again. There were many broken packages.

After tackling as many as I could, I try to restart but get

Kernel panic - not syncing: no init found. Try passing init=option to kernel.

The only questions I see don't help:

Sorry, I don't know where is the right forum for this type of overly detailed problem.

I'm totally stuck and would love to be able to boot the server again.

Some questions I've looked at (among many others):

Score:1
bg flag

/usr/sbin/mkinitramfs: 1: /usr/sbin/mkinitramfs: getopt: not found

you seem to not have getopt which is a utility that is used to parse command-line options. Check if its in a working state and reconfigure the debs.

installed initramfs-tools package post-installation script subprocess returned error exit status 1

The post-install script for the initramfs-tools package on Ubuntu systems is typically named initramfs-tools.postinst, and it is located in the /var/lib/dpkg/info directory.

jtd avatar
ar flag
jtd
Is there a way to find out which of these "getopt" packages I should reinstall (https://packages.ubuntu.com/search?keywords=getopt). I've tried removing and reinstalling `initramfs-tools` and `initramfs-tools-core`, are you suggesting I check if the file is in that directory? What if it's not there?
Rega avatar
bg flag
Glad it helped a bit, did you try to reinstall systemd too(because init)? Dependency and packages issue can be tedious to fix manually and you could have missed some still. I would create my own local repo that has all the debs from the version you are using and upgrade the system from there to sync it with fresh.
I sit in a Tesla and translated this thread with Ai:

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.