Symptoms
-
Unable to install packages via Plesk > Tools & Settings > Updates & Upgrades > Add/Remove Components or from Extensions on Digital Ocean Ubuntu 18 droplet with the error:
PLESK_INFO: Removing linux-image-4.15.0-38-generic (4.15.0-38.41) …
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-38-generic
/etc/kernel/postrm.d/x-grub-legacy-ec2:
Searching for GRUB installation directory … found: /boot/grub
Searching for default file … found: /boot/grub/default
Testing for an existing GRUB menu.lst file …Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/update-grub-legacy-ec2: line 1101: read: read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/x-grub-legacy-ec2 exited with return code 1
dpkg: error processing package linux-image-4.15.0-38-generic (–remove):
installed linux-image-4.15.0-38-generic package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-38-generic
E: Sub-process /usr/bin/dpkg returned an error code (1) -
Plesk update is failing with the same error.
Cause
This is Plesk bug with ID #PCI-164,which will be fixed in future Plesk updates.
Resolution
As a workaround, apply the following steps:
-
Connect to the server via SSH;
-
Recreate the missing
/boot/grub/menu.lst
file:# mv /boot/grub/menu.lst~ /boot/grub/menu.lst
-
Reinstall the system packages:
# DEBIAN_FRONTEND=noninteractive apt-get install -y -f