Package linux headers has no installation candidate

Issue

I am trying to set up VirtualBox on Ubuntu 18.04 but when I try to run it says:

WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (4.15.0-29-generic) or it failed to load. Please recompile the kernel module and install it by sudo /sbin/vboxconfig You will not be able to start VMs until this problem is fixed. 

So I ran sudo /sbin/vboxconfig , for which I got the following error:

vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: Building VirtualBox kernel modules. This system is currently not set up to build kernel modules. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably: linux-headers-generic linux-headers-4.15.0-29-generic This system is currently not set up to build kernel modules. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably: linux-headers-generic linux-headers-4.15.0-29-generic There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information. 

I tried to run sudo apt install linux-headers-generic linux-headers-4.15.0-29-generic but got the following error:

Reading package lists. Done Building dependency tree Reading state information. Done Package linux-headers-4.15.0-29-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-4.15.0-29-generic' has no installation candidate 

Update: This is the output of running sudo apt install virtualbox-dkms dkms

Reading package lists. Done Building dependency tree Reading state information. Done dkms is already the newest version (2.3-3ubuntu9). dkms set to manually installed. The following packages were automatically installed and are no longer required: kbuild libsdl-ttf2.0-0 module-assistant Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: virtualbox virtualbox-qt Suggested packages: vde2 virtualbox-guest-additions-iso The following packages will be REMOVED: virtualbox-5.1 The following NEW packages will be installed: virtualbox virtualbox-dkms virtualbox-qt 0 upgraded, 3 newly installed, 1 to remove and 3 not upgraded. Need to get 0 B/26.3 MB of archives. After this operation, 51.0 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database . 429944 files and directories currently installed.) Removing virtualbox-5.1 (5.1.38-122592~Ubuntu~bionic) . Selecting previously unselected package virtualbox-dkms. (Reading database . 429153 files and directories currently installed.) Preparing to unpack . /virtualbox-dkms_5.2.10-dfsg-6_all.deb . Unpacking virtualbox-dkms (5.2.10-dfsg-6) . Selecting previously unselected package virtualbox. Preparing to unpack . /virtualbox_5.2.10-dfsg-6_amd64.deb . Unpacking virtualbox (5.2.10-dfsg-6) . Selecting previously unselected package virtualbox-qt. Preparing to unpack . /virtualbox-qt_5.2.10-dfsg-6_amd64.deb . Unpacking virtualbox-qt (5.2.10-dfsg-6) . Processing triggers for mime-support (3.60ubuntu1) . Processing triggers for ureadahead (0.100.0-20) . Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) . Setting up virtualbox-dkms (5.2.10-dfsg-6) . Loading new virtualbox-5.2.10 DKMS files. Building for 4.15.0-29-generic Module build for kernel 4.15.0-29-generic was skipped since the kernel headers for this kernel does not seem to be installed. Setting up virtualbox (5.2.10-dfsg-6) . vboxweb.service is a disabled or a static unit, not starting it. Job for virtualbox.service failed because the control process exited with error code. See "systemctl status virtualbox.service" and "journalctl -xe" for details. invoke-rc.d: initscript virtualbox, action "restart" failed. ● virtualbox.service - LSB: VirtualBox Linux kernel module Loaded: loaded (/etc/init.d/virtualbox; generated) Active: failed (Result: exit-code) since Sun 2021-01-24 13:24:20 IST; 10ms ago Docs: man:systemd-sysv-generator(8) Process: 17173 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE) Jan 24 13:24:19 Tux systemd[1]: Starting LSB: VirtualBox Linux kernel module. Jan 24 13:24:19 Tux virtualbox[17173]: * Loading VirtualBox kernel modules. Jan 24 13:24:20 Tux virtualbox[17173]: * No suitable module for running kernel found Jan 24 13:24:20 Tux virtualbox[17173]: . fail! Jan 24 13:24:20 Tux systemd[1]: virtualbox.service: Control process exited, code=exited status=1 Jan 24 13:24:20 Tux systemd[1]: virtualbox.service: Failed with result 'exit-code'. Jan 24 13:24:20 Tux systemd[1]: Failed to start LSB: VirtualBox Linux kernel module. Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) . Rebuilding /usr/share/applications/bamf-2.index. Processing triggers for systemd (237-3ubuntu10) . Processing triggers for man-db (2.8.3-2) . Processing triggers for shared-mime-info (1.9-2) . Processing triggers for gnome-menus (3.13.3-11ubuntu1) . Processing triggers for hicolor-icon-theme (0.17-2) . Setting up virtualbox-qt (5.2.10-dfsg-6) . Processing triggers for ureadahead (0.100.0-20) . 

I have turned secure boot off and turned on virtualisation in bios. I have also tried to install .deb package from virutalbox wesite but still getting this erro. A clean install of 20.04 is the only thing I have not done yet.

Читайте также:  Kali linux terminal font

Solution

The issue was resolved after I installed Ubuntu 20.04.

Источник

«Package ‘linux-headers-3.13.0-27-generic’ has no installation candidate»

I’m trying to resolve an issue that I posted here. I’m basically trying to successfully run this script. To do that, I believe (and I its very possible that I’m wrong) I need to install the linux-headers-3.13.0-27-generic package. But the installation command is always failing

mg@MG-7520SE:~$ sudo apt-get install linux-headers-3.13.0-27-generic Reading package lists. Done Building dependency tree Reading state information. Done Package linux-headers-3.13.0-27-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-27-generic' has no installation candidate 

Searching using apt-cache search doesn’t return a valid result because none of the returned results match the version I need, which is 3.13.0-27

apt-cache search linux-headers linux-headers-3.16.0-23 - Header files related to Linux kernel version 3.16.0 linux-headers-3.16.0-23-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP linux-headers-3.16.0-23-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP linux-headers-generic - Generic Linux kernel headers linux-headers-lowlatency - lowlatency Linux kernel headers linux-headers-virtual - Transitional package. linux-libc-dev - Linux Kernel Headers for development linux-libc-dev-arm64-cross - Linux Kernel Headers for development (for cross-compiling) linux-libc-dev-armel-cross - Linux Kernel Headers for development (for cross-compiling) linux-libc-dev-armhf-cross - Linux Kernel Headers for development (for cross-compiling) linux-libc-dev-powerpc-cross - Linux Kernel Headers for development (for cross-compiling) linux-libc-dev-ppc64el-cross - Linux Kernel Headers for development (for cross-compiling) linux-source-3.16.0 - Linux kernel source for version 3.16.0 with Ubuntu patches linux-virtual - Minimal Generic Linux kernel and headers linux-headers-3.4.0-4-goldfish - Linux kernel headers for version 3.4.0 on Android touch emulation linux-headers-goldfish - Linux kernel headers for the goldfish kernel. linux-headers-3.16.0-24 - Header files related to Linux kernel version 3.16.0 linux-headers-3.16.0-24-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP linux-headers-3.16.0-24-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP linux-headers-3.16.0-25 - Header files related to Linux kernel version 3.16.0 linux-headers-3.16.0-25-generic - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP linux-headers-3.16.0-25-lowlatency - Linux kernel headers for version 3.16.0 on 64 bit x86 SMP 
mg@MG-7520SE:~$ uname -a Linux MG-7520SE 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux mg@MG-7520SE:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.10 Release: 14.10 Codename: utopic 

Источник

Читайте также:  Astra linux mysql server установка

Install Line 6 Toneport UX1

What am I trying to do? As the title suggests, I am trying to install the the Line 6 Toneport UX1 software. What is the problem? Upon reaching the step where I am told to enter sudo apt-get install linux-headers into Terminal in this article, I am confronted with the following message.

Reading package lists. Done Building dependency tree Reading state information. Done Package linux-headers is a virtual package provided by: linux-headers-3.5.0-27-lowlatency 3.5.0-27.30 linux-headers-3.5.0-26-lowlatency 3.5.0-26.28 linux-headers-3.5.0-25-lowlatency 3.5.0-25.25 linux-headers-3.5.0-24-lowlatency 3.5.0-24.23 linux-headers-3.5.0-23-lowlatency 3.5.0-23.22 linux-headers-3.5.0-22-lowlatency 3.5.0-22.21 linux-headers-3.5.0-21-lowlatency 3.5.0-21.19 linux-headers-3.5.0-18-lowlatency 3.5.0-18.18 linux-headers-3.5.0-27-generic 3.5.0-27.46 linux-headers-3.5.0-27 3.5.0-27.46 linux-headers-3.5.0-26-generic 3.5.0-26.42 linux-headers-3.5.0-26 3.5.0-26.42 linux-headers-3.5.0-25-generic 3.5.0-25.39 linux-headers-3.5.0-25 3.5.0-25.39 linux-headers-3.5.0-24-generic 3.5.0-24.37 linux-headers-3.5.0-24 3.5.0-24.37 linux-headers-3.5.0-23-generic 3.5.0-23.35 linux-headers-3.5.0-23 3.5.0-23.35 linux-headers-3.5.0-22-generic 3.5.0-22.34 linux-headers-3.5.0-22 3.5.0-22.34 linux-headers-3.5.0-21-generic 3.5.0-21.32 linux-headers-3.5.0-21 3.5.0-21.32 linux-headers-3.5.0-19-generic 3.5.0-19.30 linux-headers-3.5.0-19 3.5.0-19.30 linux-headers-3.5.0-18-generic 3.5.0-18.29 linux-headers-3.5.0-18 3.5.0-18.29 linux-headers-3.5.0-17-lowlatency 3.5.0-17.18 linux-headers-3.5.0-17-generic 3.5.0-17.28 linux-headers-3.5.0-17 3.5.0-17.28 You should explicitly select one to install. E: Package 'linux-headers' has no installation candidate 

What have I done? I’ve gone through the list of linux-headers (e.g. sudo apt-get install linux-headers-3.5.0-27-lowlatency 3.5.0-27.30 and onward) and I receive a message that reads as follows:

Reading package lists. Done Building dependency tree Reading state information. Done E: Unable to locate package x.x.x-x.x E: Couldn't find any package by regex 'x.x.x-x.x' 

Источник

How do I install kernel header files?

You should be able to install the kernel header files for the currently running kernel by running the following in a terminal:

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

In general, the kernel header packages are named linux-header-* where «*» indicates the version & variant (generic, server, etc.).

hey thanks but could you tell me what does generic, server, etc means i want to write (kernel driver)

Читайте также:  Create two directories linux

This won’t install the headers for future updates automatically and you’ll have to re-run this command every time. Therefore, it’s recommended to install the metapackage instead, as described in another answer.

sudo apt-get install linux-headers-generic 

if you are on a Desktop installation. The apt-get will solve the dependencies and install the correct version of kernel headers.

In Debian Wheezy I get the error message «Package linux-headers-generic is not available, but is referred to by another package. [. ] E: Package ‘linux-headers-generic’ has no installation candidate»

@IQAndreas the linux-headers-generic package is ubuntu specific. On Debian you should use sudo apt-get install linux-headers-$(uname -r)

I have linux-headers-generic installed on 18.04 but still don’t have the headers for the newest and current kernel version. Maybe it’s just a bug with this version, I’ve compiled kernel modules in earlier versions so I must’ve had the correct headers back then.

Case of Obsolete kernel package

This should cover another problem when: the currently running kernel is obsolete, meaning it’s not in the repository anymore neither its headers. So the best thing to do is to update the kernel to last version in the repository.

linux-generic is a meta package to keep current version of the kernel & its headers:

sudo apt-get update sudo apt-get install linux-generic 

Note: Depending on your Ubuntu edition, See if you need linux-lowlatency (Ubuntu Studio), linux-signed-generic or linux-virtual .

Источник

Оцените статью
Adblock
detector