1

I already tried the following:

$ sudo apt install --reinstall grub
$ sudo apt install --reinstall grub2-common
$ sudo apt install --reinstall grub-efi-amd64
$ sudo apt install --reinstall grub-efi-amd64-bin
$ sudo apt autoremove
$ sudo apt install grub-efi-amd64-signed

I get this:

Errors were encountered while processing:
 grub-efi-amd64-signed
 shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Since my topic was marked as duplicate, I showed the generosity to double check the same topic which I've already checked.

ii  linux-headers-4.15.0-39                4.15.0-39.42 all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-39-generic        4.15.0-39.42 amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-image-4.15.0-39-generic          4.15.0-39.42 amd64        Signed kernel image generic

nodes are below and I don't know how to empty them:

Filesystem     Inodes IUsed IFree IUse% Mounted on
udev             978K   535  977K    1% /dev
tmpfs            985K  1.1K  984K    1% /run
/dev/sda2         59M  176K   59M    1% /
tmpfs            985K    92  985K    1% /dev/shm
tmpfs            985K     5  985K    1% /run/lock
tmpfs            985K    18  985K    1% /sys/fs/cgroup
/dev/loop0        747   747     0  100% /snap/gnome-system-monitor/57
/dev/loop4       1.7K  1.7K     0  100% /snap/gnome-logs/45
/dev/loop7        27K   27K     0  100% /snap/gnome-3-26-1604/74
/dev/loop1        13K   13K     0  100% /snap/core/5742
/dev/loop3       1.6K  1.6K     0  100% /snap/gnome-characters/139
/dev/loop6         35    35     0  100% /snap/canonical-livepatch/50
/dev/loop5        24K   24K     0  100% /snap/spotify/26
/dev/loop8        13K   13K     0  100% /snap/core/5897
/dev/loop9       1.3K  1.3K     0  100% /snap/gnome-calculator/260
/dev/loop2        27K   27K     0  100% /snap/gtk-common-themes/818
/dev/sda1           0     0     0     - /boot/efi
tmpfs            985K    24  985K    1% /run/user/121
tmpfs            985K    35  985K    1% /run/user/1000
codear
  • 131
  • I see an issue about this: https://bugs.launchpad.net/bugs/1776271 – Alvin Liang Nov 23 '18 at 09:27
  • Related to space for EFI variable. Some work arounds: https://bugs.launchpad.net/ubuntu/+source/shim-signed/+bug/1776271 & https://ubuntuforums.org/showthread.php?t=2401166 An older version of grub or my UEFI added every entry I had in my ESP as I had backed up /EFI/ubuntu multiple times with multiple installs. That seemed to overfill the efi variable space. – oldfred Nov 23 '18 at 14:43
  • Your /dev/sda1 seems to have no space at all, total, used or free. What sort of filessytem is mounted there? It should be a FAT filesystem. – ubfan1 Nov 26 '18 at 19:42
  • @ubfan1, I let Ubuntu create everything, I'm not dual booting anything and only have 18.04. – codear Nov 27 '18 at 05:56
  • Something is wrong with sdb1. Please post the output of: sudo fdisk -l /dev/sdb |grep sdb1 and also the output of: mount |grep sdb1 – ubfan1 Nov 27 '18 at 16:18
  • fdisk: cannot open /dev/sdb: No such file or directory

    The other command didn't to anything.

    – codear Nov 27 '18 at 21:26

2 Answers2

2

Im not an expert at this topic at all but

Could not prepare Boot variable: No space left on device

sounds to me like the efi partition might be out of space. You could try to check the size of your boot partition and see if there's enough space available

Flo
  • 173
  • 1
  • 1
  • 7
0

I experienced the same error today. My /boot/efi partition still had lots of free space though. Before you do anything note that your system possibly won't be able to boot after a restart. So prepare yourself beforehand.

In my case I could solve it with a simple grub reinstall by using boot-repair.

  1. Boot from Ubuntu Live USB-Stick (in EFI-mode if your system is installed in EFI-mode)
  2. Install and launch boot-repair: sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install -y boot-repair && boot-repair

  3. Choose "Recommended Repair"

  4. Restart your system, it should boot into your OS now.

Doopy
  • 261
  • Thanks for the heads-up Doopy! I don't have a stick around me but I have a DVD. Will this resolve the issue itself or just the booting issue? – codear Nov 23 '18 at 15:34
  • Hello @Doopy, I restarted my PC but had no issue. However, I'm still unable to do any updates. Do I have to reinstall Ubuntu or can I find a way to fix this? Please note that I have 0 knowledge in linux ^.^ – codear Nov 23 '18 at 19:28
  • @CoşkuDenizArabacıoğlu This will fix the grub issue and allow you to update again. You don't have to reinstall Ubuntu, just follow my suggested steps if you don't find a better way. You should be able to simply put in your DVD, reboot and then have the choice to "Try Out Ubuntu" or something. If not, this should help. – Doopy Nov 24 '18 at 16:11
  • I have the previous version in my DVD so I'm waiting till I get my usb from the supplier. I will follow your suggestion then. – codear Nov 26 '18 at 14:04