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):