1

I get an error whenever I try to run any of the following commands

  • sudo apt upgrade

  • sudo apt install chrome-gnome-shell

  • dpkg --configure -a

  • sudo install -f

(and probably some others)

The error for sudo apt upgrade is here:

intoo@hilavitkutin:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up grub-efi-amd64 (2.02-2ubuntu8.4) ...
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 10
Setting up gdm3 (3.28.3-0ubuntu18.04.1) ...
dpkg: error processing package gdm3 (--configure):
 installed gdm3 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not configured yet.
  Package grub-pc is not installed.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Setting up unattended-upgrades (1.1ubuntu1.18.04.5) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          dpkg: error processing package unattended-upgrades (--configure):
 installed unattended-upgrades package post-installation script subprocess returned error exit status 10
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 grub-efi-amd64
 gdm3
 grub-efi-amd64-signed
 unattended-upgrades
 shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried to do all I can to fix this problem but nothing that I found on the web worked, because they relied on dpkg --configure -a and that just gives almost the same error as you can see here:

intoo@hilavitkutin:~$ sudo dpkg --configure -a
Setting up grub-efi-amd64 (2.02-2ubuntu8.4) ...
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 10
Setting up gdm3 (3.28.3-0ubuntu18.04.1) ...
dpkg: error processing package gdm3 (--configure):
 installed gdm3 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not configured yet.
  Package grub-pc is not installed.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Setting up unattended-upgrades (1.1ubuntu1.18.04.5) ...
dpkg: error processing package unattended-upgrades (--configure):
 installed unattended-upgrades package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-efi-amd64
 gdm3
 grub-efi-amd64-signed
 unattended-upgrades
 shim-signed

I also spotted the lines:

dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not configured yet.
  Package grub-pc is not installed.

I tried sudo apt install grub-pc, but it just gave this:

intoo@hilavitkutin:~$ sudo apt install grub-pc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 grub-pc : Depends: grub-common (= 2.02-2ubuntu8) but 2.02-2ubuntu8.4 is to be installed
           Depends: grub2-common (= 2.02-2ubuntu8) but 2.02-2ubuntu8.4 is to be installed
           Depends: grub-pc-bin (= 2.02-2ubuntu8) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

At the end it says that I have broken packages but I have gone into recovery mode and restored broken packages. The first time it got stuck for 3 hours so I rebooted my computer and tried again. That time it didn't have any problems.

Also, judging from the error report, I seem to have some wrong version stuff.

I am using Ubuntu 18.04.

I would really want to get this fixed since I can't even upgrade if it stays broken.

After

sudo su -
cd /boot/efi/EFI
mv ubuntu ubuntu-old

running apt install -f gives this.

root@hilavitkutin:/boot/efi/EFI# apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up grub-efi-amd64 (2.02-2ubuntu8.4) ...
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 10
Setting up gdm3 (3.28.3-0ubuntu18.04.1) ...
dpkg: error processing package gdm3 (--configure):
 installed gdm3 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not configured yet.
  Package grub-pc is not installed.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Setting up unattended-upgrades (1.1ubuntu1.18.04.5) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          dpkg: error processing package unattended-upgrades (--configure):
 installed unattended-upgrades package post-installation script subprocess returned error exit status 10
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of shim-signed:
 shim-signed depends on grub-efi-amd64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 grub-efi-amd64
 gdm3
 grub-efi-amd64-signed
 unattended-upgrades
 shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)
intoo
  • 151

2 Answers2

0

I've had a similar problem twice now, still not sure what exactly causes it but I followed the instructions from this answer which allowed the problematic grub-efi-amd64-signed package to install and then apt was able to continue with the rest of the packages.

https://askubuntu.com/a/1032156/31861

Previously when it occurred I was doing a distribution upgrade but this was just a regular update which included a package update to grub-efi-amd64-signed 1.93.7, so seems to be an ongoing issue https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1753518

Ozone
  • 568
  • Thank you for the answer. Unfortunately the solution doesn't work. Running apt install -f gives an error. I've included it in the question. – intoo Oct 18 '18 at 14:28
  • @intoo it may be you have a different issue, but one thing I forgot to mention... Are there other folders in /boot/efi/EFI ? You may have to also rename those, for example on my system (KDE Neon, Ubuntu based) the folder is called "neon", it didn't work until I also ran "mv neon neon-old" – Ozone Oct 19 '18 at 04:51
0

i hade same issue, try to find it packages/files in your pc(filesystem) and remove it, i mean this packages, by terminal, and install it all this packages one more time, one more time, probably

sudo apt remove -y  grub-efi-amd64 gdm3 grub-efi-amd64-signed unattended-upgrades shim-signed
sudo apt autoremove -y
sudo apt update
sudo apt upgrade -y 

if you see message, (recommendation to autoremove) try it, but after this action, make upgrade one more time, if autoremove is steel in recommendation in terminal, just look for location current files or packages, (you can't make autoremove), and remove it from your file system manually:

sudo rm -r /**/grub-efi-amd64
sudo rm -r /**/grub-efi-amd64-signed
sudo rm -r /**/unattended-upgrades
sudo rm -r /**/shim-signed
sudo rm -r /run/gdm3

just do not make logout or poweroff in this process.

after all process try to make this plan:

sudo apt update
sudo apt upgrade -y

if needed

sudo apt install -y  grub-efi-amd64 gdm3 grub-efi-amd64-signed unattended-upgrades shim-signed