I happen to have deleted the /boot
directory on my system instead of on the one I was supposed to.. I found this in order to restore it, however I had problems with apt --reinstall
so I decided to remove and install the packages manually. Probably not the brightest idea, now have 2 broken images that I do not know how to fix.
Running dpkg --audit
tells me
The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
linux-image-4.15.0-42-generic Signed kernel image generic
linux-image-4.15.0-43-generic Signed kernel image generic
Running dpkg --configure linux-image-4.15.0-42-generic
Setting up linux-image-4.15.0-42-generic (4.15.0-42.45) ...
Processing triggers for linux-image-4.15.0-42-generic (4.15.0-42.45) ...
/etc/kernel/postinst.d/dkms:
run-parts: failed to exec /etc/kernel/postinst.d/dkms: No such file or directory
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
dpkg: error processing package linux-image-4.15.0-42-generic (--configure):
installed linux-image-4.15.0-42-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-42-generic
However /etc/kernel/postinst.d/dkms
exists
~$ ls -l /etc/kernel/postinst.d/dkms
-rwxr-xr-x 1 root root 1120 авг 31 2016 /etc/kernel/postinst.d/dkms
My machine is still running though, is it possible to save it?
EDIT:
Just tried to run dkms
manually and found out /bin/bash
was missing. Installed it with apt install bash
and then issued the commands
dpkg --audit
apt install -f
update-grub
Everything looks normal now, however after reboot there is no ubuntu boot option in grub..
Mount the partition/s with Ubuntu file system, on /mnt
Example
Where sdx=disk, sdxx="/" partition, sdxy="boot" partition,sdxz="efi" partition
then run
Most importantly, since you have lost your /boot/grub/efi and may be /boot/grub/efi also.
Find your boot type
If internet problem.
or
For legacy/bios boot
For UEFI(efi) boot
And
Now run
to find the packages needed. Install the packages.
Then
and
Unmount mounted partitions.
Example:
For errors after rebooting.