How do I install linux headers when I am getting a "has no installation candidate" error

43,837

13.13 seems to be an old kernel from trusty? Whereas 3.16 is the kernel shipped with utopic.

If you ran do-release-upgrade lately, and you still use the old kernel be advised that all your old repositories ( where the old kernel headers reside) are disabled/cleaned from /etc/apt.

Usually doing a release upgrade bumps the kernel minor by at least 2 versions ( from 3.13 to 3.16, and with vivi to 3.18).

You have 2 options at this point. Either go with the new kernel, and install the headers for that, and then rebuild missing drivers, or readd the repository list to apt from the old ubuntu distro, and install the missing headers.

Share:
43,837

Related videos on Youtube

Rabimba Karanjai
Author by

Rabimba Karanjai

Updated on September 18, 2022

Comments

  • Rabimba Karanjai
    Rabimba Karanjai over 1 year

    Primary Problem

    I am unable to run any virtualization software. Namely Vmware or Virtualbox. Since both of them asks me to install (or produces some error which pints to ) installing build essentials and latest linux headers.

    So my problem starts with the following problem

    When I try to update using

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

    What I get is

    Reading package lists... Done Building dependency tree
    Reading state information... Done Package linux-headers-3.13.0-45-generic is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

    E: Package 'linux-headers-3.13.0-45-generic' has no installation candidate

    Header mismatch

    When I try to determine what I have by running

    apt-cache search linux-headers-
    

    I get

    Avalibale headers

    I have tried most of the things that I could find in Google and nothing quite helped. Hence hoped to find some solution here.

    • Admin
      Admin about 9 years
      You have tried apt-get update ?
    • Admin
      Admin about 9 years
      Yes. I did.Along with apt-get upgrade
    • Admin
      Admin about 9 years
      Try apt-get dist-upgrade. Looks like you are stuck with an old kernel to me.
    • Admin
      Admin about 9 years
      Did that. Didn't work. So apparently this problem starts when you upgrade from 14.04 to 14.10 using the upgrade tool. It works fine in 14.04
    • Admin
      Admin about 9 years
      What's the output of dpkg-query -l linux-generic\* linux-image\* and apt-cache policy linux-generic? It would be better to copy the output text instead of using screenshots.
  • user283885
    user283885 about 9 years
    If it's only for those drivers, and if anything else doesn't keep you from running the newer kernel, then I suggest fully go with the upgrade, because they have improved support for the virtualization subsytem (better bios/uefi detection, better IOMMU compatibility and so on). Running said command will build virtualbox drivers for the new kernel as well, if you boot into it.