0

I'm trying to update my kernel's headers (Linux 5.4.0)

sudo apt-get install build-essential linux-headers-`uname -r`  

but apparently, it wants to install allll kinds of headers for all kinds of kernels... and charges 38gb. (see here)
Going for

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

exits with the error

E: Unable to locate package linux-headers-5.4.0
E: Couldn't find any package by glob 'linux-headers-5.4.0'

Any ideas what I should be doing?

Background on this: I'm trying to install wireguard module but because the headers for 5.4.0 aren't apparent, it installs under a different kernel. I can't default when booting because I'm renting a server.

1 Answers1

0

This is discussed here.
sudo apt-get update # This will update the repositories list
sudo apt-get upgrade # This will update all the necessary packages on your system
sudo apt-get dist-upgrade # This will add/remove any needed packages
reboot # You may need this since sometimes after a upgrade/dist-upgrade, there are some left over entries that get fixed after a reboot
sudo apt-get install linux-headers-$(uname -r) # This should work now

George
  • 327
  • Thanks for the response but that's not what I'm looking for. This still doesn't work and I think it's because all the headers I see are something like "5.4.0-xxx" but my kernel is just 5.4.0. That's it. Nothing extra. So it tries to get all kinds of headers. But there isn't a right one apparently. – Deniz Grollmusz Nov 15 '22 at 11:30