Ubuntu upgrade error

Dear I got this error when I run this command . sudo dpkg --configure -a

Error: dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.38.42~18.04.29); however:
Version of linux-headers-generic-hwe-18.04 on system is 5.3.0.59.113.

dpkg: error processing package linux-generic-hwe-18.04 (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic-hwe-18.04

How can I resolve this error.

When I run this command >> sudo apt dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: The package linux-hwe-5.4-headers-5.4.0-38 needs to be reinstalled, but I can’t find an archive for it.

Please help me to resolved this error.

it sounds like there was some kind of trouble previously that lead you to run sudo dpkg --configure -a. can you run sudo apt update and sudo apt upgrade and post the output so we can get a fuller picture of what’s going on?

edit: it would also be helpful if you could provide a brief description of what you were trying to do (maybe upgrade to 20.04?) when the problems started.

3 Likes

Dear I got these error .

  1. When I run $ sudo apt update.
    Hit:1 http://mirrors.isu.net.sa/pub/ubuntu-releases bionic InRelease
    {I delete 6 links here because I unable to upload more than two links. }
    Hit:9 https://packages.microsoft.com/repos/ms-teams stable InRelease
    Fetched 494 kB in 1s (356 kB/s)
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    143 packages can be upgraded. Run ‘apt list --upgradable’ to see them.

  2. when I run $ sudo apt upgrade
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: The package linux-hwe-5.4-headers-5.4.0-38 needs to be reinstalled, but I can’t find an archive for it.


3. When I run this command $ sudo apt dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: The package linux-hwe-5.4-headers-5.4.0-38 needs to be reinstalled, but I can’t find an archive for it.

  1. when I run this command . $ sudo dpkg --configure -a

Error: dpkg: dependency problems prevent configuration of linux-generic-hwe-18.04:
linux-generic-hwe-18.04 depends on linux-headers-generic-hwe-18.04 (= 5.4.0.38.42~18.04.29); however:
Version of linux-headers-generic-hwe-18.04 on system is 5.3.0.59.113.

dpkg: error processing package linux-generic-hwe-18.04 (–configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-generic-hwe-18.04

this information might also be helpful when trying to figure out what to do next:

also if you could run inxi -Fxz and post the output. thanks :slight_smile:

  1. inxi -Fxz

Command ‘inxi’ not found, but can be installed with:

sudo apt install inxi

  1. sudo apt install inxi
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: The package linux-hwe-5.4-headers-5.4.0-38 needs to be reinstalled, but I can’t find an archive for it.

trying this one last time…

I just do normal update and upgrade .

I try these >
maidul@maidul-Inspiron-5567:~$ uname -a
Linux maidul-Inspiron-5567 5.4.0-38-generic #42~18.04.1-Ubuntu SMP Mon Jun 15 09:48:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
maidul@maidul-Inspiron-5567:~$ uname -r
5.4.0-38-generic

maidul@maidul-Inspiron-5567:~$ cd /boot
maidul@maidul-Inspiron-5567:/boot$ ls
config-5.3.0-53-generic memtest86+.elf
config-5.3.0-59-generic memtest86+_multiboot.bin
config-5.4.0-38-generic System.map-5.3.0-53-generic
grub System.map-5.3.0-59-generic
initrd.img-5.3.0-53-generic System.map-5.4.0-38-generic
initrd.img-5.3.0-59-generic vmlinuz-5.3.0-53-generic
initrd.img-5.4.0-38-generic vmlinuz-5.3.0-59-generic
memtest86+.bin vmlinuz-5.4.0-38-generic

I don’t know much. Please have a look at that and let me know.

2 Likes

thank you for that output. uname -a was going to be my next request and you beat me to it. i wasn’t thinking of listing what was in /boot, but that was very helpful :slight_smile:

i think i am as confused as your computer about how it was able to install and use the 5.4.0-38-generic kernel, but failed to get the headers at the same time.

i think one way to try first is with the suggestions on this page: https://www.maketecheasier.com/fix-broken-packages-ubuntu/
to see if apt can fix the situation.

i would start with
sudo apt update --fix-missing
to see if that will bring in the missing headers. i would then try
sudo apt install -f
if the --fix-missing option doesn’t work.

1 Like

Here is the Output:

sudo apt update --fix-missing
[sudo] password for maidul:
Hit:10 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Get:22 http://archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 DEP-11 Metadata [1,288 B]
Fetched 5,061 kB in 3s (1,968 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
143 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
maidul@maidul-Inspiron-5567:~$ sudo apt install -f
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: The package linux-hwe-5.4-headers-5.4.0-38 needs to be reinstalled, but I can’t find an archive for it.

2 Likes

can you try sudo apt install -f next?

edit: my apologies. i missed that output at the bottom

1 Like

from this part of a previous post

i gather that you are running ubuntu 18.04. can you confirm that please? in addition, are you running regular ubuntu with the gnome desktop environment?

do you see the grub screen when you boot so that you can choose to run a memtest or boot into a different kernel?

1 Like

yes I am using 18.04. desktop version.
yes i seen there is four options comming when booting . like ubuntu, ubuntu memtest , 3rd and 4th options
let me know what can I do?

my distro is based on ubuntu 18.04 and i can’t even find 5.4.0-38 listed in the repositories :thinking: did you possibly install it with something like ukuu?

my next thought would be to try booting into a different kernel. one of those options at the grub menu other than the first and memtest is to boot into is something like “recovery mode”. when you highlight it and press enter you usually get a choice of which kernel you want to try. just make sure it is something other than the 5.4.0-38 that you are currently using and has the missing headers.

if you are able to successfully boot (i can’t see why you wouldn’t be from what you listed in /boot [thank you again for thinking of that]), i would try updating to see if that removes both the kernel and problematic missing headers archive.

3 Likes

Hi,

I would suggest the same.

On the grub menu, use the additional option and boot into an older kernel. From there, update your system.

See if it works.

1 Like

I choose older kurnel : 5.3.0-53-generic
Then I did those command : sudo apt update and sudo apt upgrade.

Here is the error: E: The package linux-hwe-5.4-headers-5.4.0-38 needs to be reinstalled, but I can’t find an archive for it.
Same error . Please let me know.

1 Like

I choose old kernel . It is same error . Please let me know.

You need to use the current version of the kernel, that has corresponding headers currently in the repositories. Then you need to reinstall these corresponding kernel headers, as the message is telling you.

https://www.tecmint.com/install-kernel-headers-in-ubuntu-and-debian/

2 Likes

however that kernel was installed, neither it nor the headers exist in the present repositories that i could find in either an online search or with synaptic package manager in both my ubuntu 18.04-based distro (bodhi 5.1) or an 18.04 vm. for whatever reason the -37 and -39 kernels still exist, but there is no trace of -38.

of course since you (@droidmaid) have a mostly functional system, having a backup in place before making system changes is very much recommended.

what looks like the easier way to remove that is to try the command sudo apt-get autoremove --purge. after that you could run sudo apt upgrade or ls /boot again to see if the purge command was successful. if it did work, you would want to make sure and update your grub configuration with sudo update-grub.

if it was not successful, the page linked below describes how to use (among other options) a program called synaptic package manager (also available in the software center if a graphical installation is easier or preferred) to remove the old kernel. of couse after doing so you would want to update grub as well.

2 Likes