0

I am using Ubuntu 20.04 LTS and I am unable to install packages from apt or apt-get. Whenever I try to install a package, the process terminates with the following error

E: The package linux-headers-5.4.0-56 needs to be reinstalled, but I can't find an archive for it.

I tried to install it manually for my kernel but it keeps throwing the same error again

$ sudo apt install linux-header-$(uname -r)

Reading package lists... Done Building dependency tree
Reading state information... Done E: The package linux-headers-5.4.0-56 needs to be reinstalled, but I can't find an archive for it.

To try out from a different kernel, I have booted to an older kernel version (5.4.0-54) from grub but had no luck.

This error prevents me from installing a new package and also from upgrading the existing packages. Any assistance on this would be appreciated.

1 Answers1

2

Step 1: Download the package directly from Launchpad: https://launchpad.net/ubuntu/focal/amd64/linux-headers-5.4.0-56-generic/5.4.0-56.62.

Step 2: Put the downloaded package in your /var/cache/apt/archives directory. Apt will look here first for the .deb

Step 3: Try the reinstall again: sudo apt install --reinstall linux-headers-5.4.0-56

user535733
  • 62,253