0

Every time I try to install updates using the update manager on Linux Mint 20.1 I get the following message :

E: grub-pc: installed grub-pc package post-installation script subprocess returned error exit status 1
E: friendly-recovery: installed friendly-recovery package post-installation script subprocess returned error exit status 1
E: grub-efi-amd64-signed: dependency problems - leaving unconfigured
E: linux-image-5.4.0-67-generic: installed linux-image-5.4.0-67-generic package post-installation script subprocess returned error exit status 1
E: linux-image-5.4.0-70-generic: installed linux-image-5.4.0-70-generic package post-installation script subprocess returned error exit status 1

I am new to Linux, what can I do ?

Any help will be appreciated

PS : output of cat /etc/apt/sources.list.d/official-package-repositories.list:

deb http://packages.linuxmint.com ulyssa main upstream import backport #id:linuxmint_main

deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ focal partner

output of uname -a :

Linux amandanotebook 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

output of 'fdisk -l':

Disk /dev/sda: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10SPZX-80Z
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 408BDF6F-6F00-4AA7-84D8-E1983D1E8F08

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1050623    1048576  512M EFI System
/dev/sda2  1050624 1953523711 1952473088  931G Linux filesystem

output of 'efibootmgr-v':

BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0001,0003,0004
Boot0000* Windows Boot Manager  VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0001* UEFI:CD/DVD Drive BBS(129,,0x0)
Boot0002* ubuntu    HD(1,GPT,b0b1778e-9099-4055-95c0-8b7b3318b306,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0003* UEFI:Removable Device BBS(130,,0x0)
Boot0004* UEFI:Network Device   BBS(131,,0x0)

Editor's note: So I boot in UEFI mode, in spite having grub-pc package partially installed, could be the cause, or related.

output of 'history | grep grub-pc' :

53  sudo apt install grub-pc
   63  /var/lib/dpkg/info/grub-pc.postinst 
   64  /var/lib/dpkg/info/grub-pc.postinst
   65  sudo /var/lib/dpkg/info/grub-pc.postinst
   66  /var/lib/dpkg/info/grub-pc.postinst
   78  sudo apt reinstall grub-pc
  105  sudo apt-get remove grub-pc-bin
  110  sudo apt-get remove grub-pc-bin
  112  history | grep grub-pc

output of 'dpkg --list | grep "grub*" '

ii  grub-common                                   2.04-1ubuntu26.9                      amd64        GRand Unified Bootloader (common files)
iF  grub-efi-amd64                                2.04-1ubuntu26.9                      amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 version)
ii  grub-efi-amd64-bin                            2.04-1ubuntu26.9                      amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 modules)
iU  grub-efi-amd64-signed                         1.142.11+2.04-1ubuntu26.9             amd64        GRand Unified Bootloader, version 2 (EFI-AMD64 version, signed)
ii  grub2-common                                  2.04-1ubuntu26.9                      amd64        GRand Unified Bootloader (common files for version 2)


output of sudo apt get purge

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'grub-pc' is not installed, so not removed
Package 'grub-pc-bin' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  linux-headers-5.4.0-60 linux-headers-5.4.0-60-generic linux-headers-5.4.0-67
  linux-headers-5.4.0-67-generic linux-image-5.4.0-60-generic
  linux-image-unsigned-5.4.0-67-generic linux-modules-5.4.0-60-generic
  linux-modules-5.4.0-67-generic linux-modules-extra-5.4.0-67-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-unsigned-5.4.0-67-generic (5.4.0-67.75) ...
Setting up linux-image-5.4.0-70-generic (5.4.0-70.78) ...
Setting up grub-efi-amd64 (2.04-1ubuntu26.9) ...
(EE) 
Fatal server error:
(EE) Server is already active for display 0
    If this server is no longer running, remove /tmp/.X0-lock
    and start again.
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
(EE) 
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 1
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
Processing triggers for linux-image-unsigned-5.4.0-67-generic (5.4.0-67.75) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-67-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-67-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
(EE) 
Fatal server error:
(EE) Server is already active for display 0
    If this server is no longer running, remove /tmp/.X0-lock
    and start again.
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
(EE) 
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-unsigned-5.4.0-67-generic (--configure):
 installed linux-image-unsigned-5.4.0-67-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-70-generic (5.4.0-70.78) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-70-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-70-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
(EE) 
Fatal server error:
(EE) Server is already active for display 0
    If this server is no longer running, remove /tmp/.X0-lock
    and start again.
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
(EE) 
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.4.0-70-generic (--configure):
 installed linux-image-5.4.0-70-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-efi-amd64
 grub-efi-amd64-signed
 linux-image-unsigned-5.4.0-67-generic
 linux-image-5.4.0-70-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
4
  • Ok, now, to fix it, we need to remove (with config) the grub-pc as in sudo apt-get purge grub-pc grub-pc-bin, and then sudo dpkg --configure --pending, please post both outputs, please try running sudo apt-get update again, and if it works now, then sudo apt-get --reinstall install grub-efi-amd64, this could fix it, in theory. – LinuxSecurityFreak Apr 2 at 16:33
  • 'sudo apt -get purge ' gives me a error. See it at post – Physmath Apr 3 at 1:02
  • Your X11 server is running? I mean the normal user GUI environment. It's interesting that it blows on /tmp/.X0-lock file. – LinuxSecurityFreak Apr 3 at 4:03
  • Why did you try to install unsigned kernel as in linux-image-unsigned-5.4.0-67-generic, pls post uname -r to see what version of kernel you booted and if "normal" then go ahead and sudo apt-get purge linux-image-unsigned-5.4.0-67-generic – LinuxSecurityFreak Apr 3 at 4:14

Your Answer

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

Browse other questions tagged or ask your own question.