Dist-Upgrade failure / old linux-image-7.0.0-12-generic package postrm maintainer script subprocess failed with exit status 1
Hi DevTeam,
Keep getting this error for the last few days.
Would be great if the error message would be a bit more verbose.
And if dpkg -a would sort it ;)
I used GrubCustomizer a few days ago - did not change much, except for graphic layout
Original and Edited Grub Config - attached.
Cheers
***
sudo apt upgrade
[sudo: authenticate] Password:
The following package was automatically installed and is no longer required:
nvidia-
Use 'sudo apt autoremove' to remove it.
REMOVING:
linux-
Summary:
Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
3 not fully installed or removed.
Freed space: 17.3 MB
Continue? [Y/n] y
(Reading database… 361247 files and directories currently installed.)
Removing linux-image-
/etc/kernel/
update-initramfs: Deleting /boot/initrd.
/etc/kernel/
kdump-tools: Removing kdump tracking files for kernel version: 7.0.0-12-generic
/etc/kernel/
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found memtest86+ 64bit EFI image: /boot/mt86+x64
Found memtest86+ 32bit EFI image: /boot/mt86+ia32
Found memtest86+ 64bit image: /boot/mt86+x64
Found memtest86+ 32bit image: /boot/mt86+ia32
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot
entries.
Found Windows Boot Manager on /dev/nvme1n1p1@
Adding boot menu entry for UEFI Firmware Settings ...
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 338
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/
run-parts: /etc/kernel/
dpkg: error processing package linux-image-
old linux-image-
iled with exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)
***
sudo dpkg --configure -a
Setting up linux-image-
Setting up linux-image-
Processing triggers for linux-image-
/etc/kernel/
update-initramfs: Generating /boot/initrd.
/etc/kernel/
kdump-tools: Generating /var/lib/
/etc/kernel/
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found memtest86+ 64bit EFI image: /boot/mt86+x64
Found memtest86+ 32bit EFI image: /boot/mt86+ia32
Found memtest86+ 64bit image: /boot/mt86+x64
Found memtest86+ 32bit image: /boot/mt86+ia32
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme1n1p1@
Adding boot menu entry for UEFI Firmware Settings ...
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 338
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/
run-parts: /etc/kernel/
dpkg: error processing package linux-image-
old linux-image-
Processing triggers for linux-image-
/etc/kernel/
update-initramfs: Generating /boot/initrd.
/etc/kernel/
kdump-tools: Generating /var/lib/
/etc/kernel/
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
Found memtest86+ 64bit EFI image: /boot/mt86+x64
Found memtest86+ 32bit EFI image: /boot/mt86+ia32
Found memtest86+ 64bit image: /boot/mt86+x64
Found memtest86+ 32bit image: /boot/mt86+ia32
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/nvme1n1p1@
Adding boot menu entry for UEFI Firmware Settings ...
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 338
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/
run-parts: /etc/kernel/
dpkg: error processing package linux-image-
old linux-image-
Errors were encountered while processing:
linux-
linux-
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 7.0.0-13-generic x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckR
CrashDB: ubuntu
CurrentDesktop: ubuntu:GNOME
Date: Wed Apr 22 20:32:42 2026
InstallationDate: Installed on 2026-02-03 (78 days ago)
InstallationMedia: Ubuntu 24.04.3 LTS "Noble Numbat" - Release amd64 (20250805.1)
PackageArchitec
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-
XDG_RUNTIME_
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: ubuntu-
Symptom: dist-upgrade
UpgradeStatus: No upgrade log present (probably fresh install)
VarLogDistupgra
mtime.conffile.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu grub Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Manfred Hampl
- Solved:
- Last query:
- Last reply:
This question was originally filed as bug #2149961.
