Wednesday, May 8, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1205  / 1 Year ago, fri, may 12, 2023, 4:34:55

I have a Dell Precision 64 bit laptop and having trouble updating the packages on Ubuntu 20.10.
I have few kernels installed on my machine which I got as part of the regular updates I get from Ubuntu. But I started getting issues after an update to linux-image-5.8.0-31-generic. So I am currently using the kernel 5.8.0-29-generic. Everything works well except when I try to update any packages.
When I do apt upgrade, I get the following error.


sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package linux-modules-extra-5.8.0-31-generic needs to be reinstalled, but an archive for it can't be found.

Below are the OS details


lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.10
Release: 20.10
Codename: groovy


uname -a
Linux precision-3541 5.8.0-29-generic #31-Ubuntu SMP Fri Nov 6 12:37:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


I get the following when I list out all the kernels


╭─ ~                                                                                                                                                                     ✔  1126  19:12:21
╰─ sudo dpkg --list | egrep -i --color 'linux-image|linux-headers'
ii linux-headers-4.15.0-1037-oem 4.15.0-1037.42 amd64 Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii linux-headers-5.8.0-28 5.8.0-28.30 all Header files related to Linux kernel version 5.8.0
ii linux-headers-5.8.0-28-generic 5.8.0-28.30 amd64 Linux kernel headers for version 5.8.0 on 64 bit x86 SMP
ii linux-headers-5.8.0-29 5.8.0-29.31 all Header files related to Linux kernel version 5.8.0
ii linux-headers-5.8.0-29-generic 5.8.0-29.31 amd64 Linux kernel headers for version 5.8.0 on 64 bit x86 SMP
ii linux-headers-generic 5.8.0.29.34 amd64 Generic Linux kernel headers
rc linux-image-4.15.0-1037-oem 4.15.0-1037.42 amd64 Signed kernel image oem
ii linux-image-4.15.0-1081-oem 4.15.0-1081.91 amd64 Signed kernel image oem
rc linux-image-5.4.0-31-generic 5.4.0-31.35 amd64 Signed kernel image generic
rc linux-image-5.4.0-33-generic 5.4.0-33.37 amd64 Signed kernel image generic
rc linux-image-5.4.0-37-generic 5.4.0-37.41 amd64 Signed kernel image generic
rc linux-image-5.4.0-39-generic 5.4.0-39.43 amd64 Signed kernel image generic
rc linux-image-5.4.0-40-generic 5.4.0-40.44 amd64 Signed kernel image generic
rc linux-image-5.4.0-42-generic 5.4.0-42.46 amd64 Signed kernel image generic
rc linux-image-5.4.0-45-generic 5.4.0-45.49 amd64 Signed kernel image generic
rc linux-image-5.4.0-48-generic 5.4.0-48.52 amd64 Signed kernel image generic
rc linux-image-5.4.0-52-generic 5.4.0-52.57 amd64 Signed kernel image generic
rc linux-image-5.8.0-26-generic 5.8.0-26.27 amd64 Signed kernel image generic
ii linux-image-5.8.0-28-generic 5.8.0-28.30 amd64 Signed kernel image generic
ii linux-image-5.8.0-29-generic 5.8.0-29.31 amd64 Signed kernel image generic
iU linux-image-5.8.0-31-generic 5.8.0-31.33 amd64 Signed kernel image generic
iU linux-image-generic 5.8.0.31.36 amd64 Generic Linux kernel image


I get the same error if I attempt to remove the kernel


╭─ ~                                                                                                                                                                   1 ↵  1122  19:10:17
╰─ sudo apt remove linux-image-5.8.0-31-generic --verbose-versions
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package linux-modules-extra-5.8.0-31-generic needs to be reinstalled, but an archive for it can't be found.


I am not sure what else to try to get this fized. Can someone please help me fix this?


More From » package-management

 Answers
5

I would recommend low level removal of problematic packages by using commands below:


sudo dpkg -P --force-all linux-modules-extra-5.8.0-31-generic
sudo dpkg -P --force-all $(dpkg --list | egrep -i --color 'linux-image|linux-headers' | grep ^rc | awk '{print $2}')

and then remove remaining kernel packages by


sudo apt-get update
sudo apt-get install byobu
sudo purge-old-kernels

And finally install latest upgrades by


sudo apt-get dist-upgrade

[#1689] Saturday, May 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
throecember

Total Points: 274
Total Questions: 118
Total Answers: 132

Location: India
Member since Thu, Jun 11, 2020
4 Years ago
;