Score:0

Ubuntu package manager error: E: The package linux-headers-5.15.0-58 needs to be reinstalled, but I can't find an archive for it

lb flag

Every time I try to install a package like using the command below

sudo apt install git

I get the output

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

I am currently on Ubuntu 22.04.1 LTS. I've been trying to fix it with commands from this post: Ubuntu won't update: "The package linux-modules-5.19.0-32-generic needs to be reinstalled", but I can't find an archive for it. Obviously, the issue in that thread is from a different version.I have also tried other commands from this thread: Linux-Headers Reinstall

Any ideas on how to fix this error?

guiverc avatar
cn flag
You've not mentioned what OS/release you're actually using; I see reference for it for *focal* (20.04), is what what you're using? https://packages.ubuntu.com/search?keywords=linux-headers-5.15.0-58&searchon=names&suite=all&section=all as 5.15 is used by multiple releases. I'd start with `sudo apt update` & check all lines of output are there, no warnings/errors & no missing lines etc.. ie. check your sources after you work out what OS/release you're using (we're limited to details you tell us)
Ekos avatar
lb flag
Attempts to fetch updates through sudo apt update work but using sudo apt upgrade does not and results in the same package error.
user535733 avatar
cn flag
You have two options: You can 1) Download the correct package from launchpad.net, reinstall it, then remove with full automatic cleanup using apt, or 2) Force-uninstall the package, and clean up all the installed files manually. Both methods work if done properly. Your link does the easy part of #2 (it skips the cleanup). It's unclear what problem you are encountering since the question does not include complete input/output of whatever you tried.
user535733 avatar
cn flag
Don't comment on your own question. [Edit your question](https://askubuntu.com/posts/1484465/edit) instead to add information and answer questions. Comments are intended to help you refine and improve your question until it is answerable. Then somebody will answer it.
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.