I was upgrading Ubuntu using

sudo apt-get upgrade -y 

But, the terminal crashed in between. When I tried to run the same command again, it gave an error related to lock on dpkg. I deleted the lock files. Now when I run the command, I get the following error

1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up shim-signed (1.33.1~16.04.3+15+1533136590.3beb971-0ubuntu1) ...
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
dpkg: error processing package shim-signed (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am not sure what is wrong here.


First confirm whether or not you are running an EFI boot version of Ubuntu.

If you are not then:

  • This will never work right, because shim-signed is a EFI application.

If you are then:

  • Make sure your EFI boot directory/partition is properly referenced.

  • Then purge shim-signed, apt-get purge shim-signed then I would attempt the update and upgrade or reinstall of shim-signed, after a reboot.

You could also try something similar to the following: (change to suit your situation)

  • Be vary sure you know what these commands do and where you want them to place things as doing it wrong will most likely render your system non-bootable.

    mkdir /boot/efi
    grub-install --efi-directory=/boot/efi --target=x86_64-efi /dev/sdX (path to drive where grub is installed).
    apt-get update
    apt-get upgrade
| improve this answer | |
  • Thanks, but how to know if it EFI boot version. This used to work earlier. Only after the terminal crash during the upgrade, it gives this error. – Ashwani K Jan 30 '19 at 6:09
  • How to Make sure your EFI boot directory/partition is properly referenced? – Ashwani K Jan 30 '19 at 6:09
  • Check your fstab and see if you have a boot/efi entry if so good, if not do the following: Check to make sure the directory actually exists on the system ( /boot/efi ) if so good. If your system has both in place other things are amiss. If you have neither then look into why? Also check the permissions of the directory. – Michael Prokopec Jan 30 '19 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.