dpkg: error processing package linux-image-5.4.0-84-generic

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
W Michael
Level 1
Level 1
Posts: 20
Joined: Mon Nov 08, 2021 3:40 pm

dpkg: error processing package linux-image-5.4.0-84-generic

Post by W Michael »

This is my first time on a forum of any type
Operating System
----------------
Kernel : Linux 5.4.0-81-generic (x86_64)
Version : #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021
C Library : GNU C Library / (Ubuntu GLIBC 2.31-0ubuntu9.2) 2.31
Distribution : Linux Mint 20.2
I can no longer add or remove packages or do any minor or major updates. This is true if I use Update Manager, Synaptic Package Manager or the terminal. However the system does everything else without any error.
The error messages are always a version of:

Code: Select all

 linux-image-5.4.0-80-generic: installed linux-image-5.4.0-80-generic package post-removal script subprocess returned error exit status 1

dpkg: error processing package linux-image-5.4.0-84-generic (--configure):
installed linux-image-5.4.0-84-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-5.4.0-90-generic
linux-image-5.4.0-84-generic
I heard that this problem is the result of a bug in an update. I am not great with linux but have stumbled my way through with the help of friends, online documentation, and tutorials.
Thaks in advance

Michael
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sleeper12
Level 21
Level 21
Posts: 14604
Joined: Thu May 25, 2017 3:22 pm

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by sleeper12 »

Try:

Code: Select all

 sudo apt autoremove 
W Michael
Level 1
Level 1
Posts: 20
Joined: Mon Nov 08, 2021 3:40 pm

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by W Michael »

Hi sleeper12
I think I tried that before and it or a similar attempt steered me towards dpkg. I tried it again and here is what I got:

Code: Select all

$ sudo apt autoremove
[sudo] password for user1:      
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-5.4.0-80-generic
0 upgraded, 0 newly installed, 1 to remove and 22 not upgraded.
3 not fully installed or removed.
After this operation, 11.8 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 435122 files and directories currently installed.)
Removing linux-image-5.4.0-80-generic (5.4.0-80.90) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-80-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: n;else sudo sed -i s/GRUB_CMDLINE_LINUX_DEFAULT=/GRUB_CMDLINE_LINUX_DEFAULT= /etc/default/grub: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.4.0-80-generic (--remove):
 installed linux-image-5.4.0-80-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.4.0-80-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
~$ 
NOTE: last line
I have an other machine that was updated on a different schedule and its kernel now is linux-image-5.4.0-89-generic. the last update was done just before this reply
User avatar
karlchen
Level 23
Level 23
Posts: 18231
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by karlchen »

Hello, w michael.

See the following 2 lines from your "sudo apt autoremove" output:

Code: Select all

Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: n;else sudo sed -i s/GRUB_CMDLINE_LINUX_DEFAULT=/GRUB_CMDLINE_LINUX_DEFAULT= /etc/default/grub: not found
This seems to suggest to me either of 2 things:
Either your file /etc/default/grub does no longer exist,
or your file /etc/default/grub is corrupt.

Please, share the output of the following 2 terminal commands with us:

Code: Select all

ls -l /etc/default/grub

cat /etc/default/grub
Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
W Michael
Level 1
Level 1
Posts: 20
Joined: Mon Nov 08, 2021 3:40 pm

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by W Michael »

Hi Karl
Here is the output:

Code: Select all

$ ls /etc/default/grub
/etc/default/grub

Code: Select all

$ ls /etc/default
acpid            console-setup  intel-microcode      openvpn
acpi-support     crda           irqbalance           rsync
add-apt-key      cron           kerneloops           saned
alsa             cryptdisks     keyboard             timeshift.json
amd64-microcode  dbus           locale               ufw
anacron          grub           motd-news            useradd
avahi-daemon     grub.d         networkd-dispatcher
bsdmainutils     hddtemp        networking
cacerts          im-config      nss

Code: Select all

$ cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
# Original
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# Hibernate mod
\n$RESUME_PARAMS";else sudo sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="$RESUME_PARAMS" /etc/default/grub"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
$ 
I am going to do a meld comparison of this grub and the one on my other computer which updates without error and which on casual examination looks the same
Cheers
W Michael
Level 1
Level 1
Posts: 20
Joined: Mon Nov 08, 2021 3:40 pm

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by W Michael »

Hi Karl
Meld makes life easier,. I compared the grub files from my two linux mint machines, two lines were different and edited the problem version to match the good one, rebooted, and ran update manager. No errors, system is up-to-date. THANKS!!! Tomorrow I will get to work in the software I need to get running.
Once again Thanks All
Cheers

Michael
User avatar
karlchen
Level 23
Level 23
Posts: 18231
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by karlchen »

Hello, Michael.

Let me make an educated guess. These were the 2 lines identified as problematic:

Code: Select all

#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# Hibernate mod
\n$RESUME_PARAMS";else sudo sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="$RESUME_PARAMS" /etc/default/grub"
The first line should never be commented out completely, even if you remove both arguments quiet and splash from it. You have to leave the pair of double quotes thus assigning an empty string as the value to the parameter GRUB_CMDLINE_LINUX_DEFAULT.
The minimal content of the line will be: GRUB_CMDLINE_LINUX_DEFAULT=""
The line starting with # Hibernate \n ... looks pretty garbled. Should not be present in /etc/default/grub at all, me thinks.

Are my findings correct? Or which differences to a functional file /etc/default/grub did you identify?

Regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
W Michael
Level 1
Level 1
Posts: 20
Joined: Mon Nov 08, 2021 3:40 pm

Re: dpkg: error processing package linux-image-5.4.0-84-generic

Post by W Michael »

Hi Karl
You were right on track
Using the grub file from my working linux mint as a model
this is what my fixed grub looked like the changes are indicated by FIX:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian
# Original
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
# Hibernate mod

# FIX`
# added
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Removed
# \n$RESUME_PARAMS";else sudo sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="$RESUME_PARAMS" /etc/default/grub"

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

I could not survive without people like you and the rest of the Linux Giftware community
Thanks

Michael
Locked

Return to “Software & Applications”