Score:0

Unable to install anything using apt-get or update - error about GRUB configuration file and processing kernel image

pw flag
(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
guiverc avatar
cn flag
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?
Y DE avatar
pw flag
@karel it seem not working i tried it same error
karel avatar
sa flag
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.
Y DE avatar
pw flag
@karel you mean there is something worng here https://pastebin.com/XqEppWf3 this is my sources.list file
karel avatar
sa flag
Your pastebin paste is OK, but your system has packages not for 20.04 currently installed which is causing the package management errors.
Y DE avatar
pw flag
@karel but how can I find them
karel avatar
sa flag
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`
Y DE avatar
pw flag
@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?
karel avatar
sa flag
[How to list manually installed packages?](https://askubuntu.com/q/2389/) Save the list of manually installed packages and then reinstall them with a command of the form `sudo apt install package1 package2`
Y DE avatar
pw flag
@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?
karel avatar
sa flag
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.
Y DE avatar
pw flag
There is something that I do not understand installing from snap works but from apt, i get the error why this happens
karel avatar
sa flag
Your package management issue is with apt packages only, not with any snap packages.
Score:0
zw flag

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
Y DE avatar
pw flag
Still getting the same Error
Y DE avatar
pw flag
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)
N0rbert avatar
zw flag
Please run `sudo update-grub` and retry. If error log is long - upload it to pastebin and share the link.
Y DE avatar
pw flag
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-grub`and the rest are the same error
Y DE avatar
pw flag
https://pastebin.com/zzyr2TzB
N0rbert avatar
zw flag
Please also share the contents of `cat /etc/default/grub` and `ls /etc/grub.d/*` and `cat /etc/grub.d/*` .
Y DE avatar
pw flag
https://pastebin.com/UiGkFqdX
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.