0
(Reading database ... 234944 files and directories currently installed.)
Removing linux-image-5.8.0-55-generic (5.8.0-55.62~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.8.0-55-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Script `/boot/grub/grub.cfg.new' contains no commands and will do nothing
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/grub.cfg.new file attached.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.8.0-55-generic (--remove):
 installed linux-image-5.8.0-55-generic package post-removal script subprocess r
eturned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-5.8.0-55-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ lsb_release -a
No LSB modules are available.                                      
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal
Zanna
  • 70,465
Y DE
  • 11
  • 1
    You've provided no OS & release, however many of the packages in your paste are rather out-of-date or from EOL releases. What OS & release are you using? – guiverc Sep 18 '21 at 10:32
  • @karel it seem not working i tried it same error – Y DE Sep 18 '21 at 11:05
  • You have repositories not for Ubuntu 20.04 currently enabled and packages not for Ubuntu 20.04 currently installed. This is causing package management errors. – karel Sep 18 '21 at 11:07
  • @karel you mean there is something worng here https://pastebin.com/XqEppWf3 this is my sources.list file – Y DE Sep 18 '21 at 11:18
  • Your pastebin paste is OK, but your system has packages not for 20.04 currently installed which is causing the package management errors. – karel Sep 18 '21 at 11:21
  • @karel but how can I find them – Y DE Sep 18 '21 at 11:22
  • Use the rmadison tool which is provided by sudo apt install devscripts on each package in the output to identify packages with incompatible with 20.04 versions. Syntax: rmadison linux-generic – karel Sep 18 '21 at 11:24
  • @karel it seems that i can not install the packages for the same error I really do not know what to do I have this problem for like three months, I am thinking of changing the distro but I want to make sure that my data won't be gone, is there a way to change the disto without losing the packages and programs that I have installed? – Y DE Sep 18 '21 at 11:31
  • How to list manually installed packages? Save the list of manually installed packages and then reinstall them with a command of the form sudo apt install package1 package2 – karel Sep 18 '21 at 11:35
  • @karel I just have one thing in mind before doing this, if what you said is right that there is a package that is not compatible with my version of ubuntu then if I save the list of all the packages won't the same package get installed and I will get the same problem? – Y DE Sep 18 '21 at 11:45
  • Don't try to reinstall any packages that have version numbers in their names. Most manually installed packages don't have version numbers in their names. If the package has a version number in its name you can use a command of the form apt search package1 to find the correct version. That will get you a working system. – karel Sep 18 '21 at 11:47
  • There is something that I do not understand installing from snap works but from apt, i get the error why this happens – Y DE Sep 18 '21 at 11:53
  • Your package management issue is with apt packages only, not with any snap packages. – karel Sep 18 '21 at 12:06

1 Answers1

0

You have to move problematic file out the way by

sudo mv /boot/grub/grub.cfg.new ~
sudo update-grub

and then resume package installation by

sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get dist-upgrade
N0rbert
  • 99,918
  • Still getting the same Error – Y DE Sep 18 '21 at 10:21
  • dpkg: error processing package linux-image-5.8.0-55-generic (--remove): installed linux-image-5.8.0-55-generic package post-removal script subprocess returned error exit status 1 dpkg: too many errors, stopping Errors were encountered while processing: linux-image-5.8.0-55-generic Processing was halted because there were too many errors. E: Sub-process /usr/bin/dpkg returned an error code (1) – Y DE Sep 18 '21 at 10:22
  • Please run sudo update-grub and retry. If error log is long - upload it to pastebin and share the link. – N0rbert Sep 18 '21 at 10:24
  • I got this Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Script `/boot/grub/grub.cfg.new' contains no commands and will do nothing 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/grub.cfg.new file attached. when running sudo update-gruband the rest are the same error – Y DE Sep 18 '21 at 10:26
  • https://pastebin.com/zzyr2TzB – Y DE Sep 18 '21 at 10:33
  • Please also share the contents of cat /etc/default/grub and ls /etc/grub.d/* and cat /etc/grub.d/* . – N0rbert Sep 18 '21 at 10:36
  • https://pastebin.com/UiGkFqdX – Y DE Sep 18 '21 at 10:43