What is kernel devel linux

Linux packages

To add the necessary modules to the Linux kernel, the setup program needs the following Linux packages:

  • The package with kernel headers or sources. The package version must match the kernel version.
  • The GNU Compiler Collection (GCC) compiler system. The GCC version must be the one with which the kernel was compiled.
  • The Make tool.
  • The Perl interpreter.
  • The libelf-dev , libelf-devel , or elfutils-libelf-devel libraries for building kernels starting with 4.15 and configured with CONFIG_UNWINDER_ORC=y. For some distributions, such as Fedora 28, they need to be installed separately from kernel headers.

The names of these packages vary depending on your Linux distribution.

In Red Hat Enterprise Linux, CentOS, and Fedora, the packages normally will be installed by the setup program. In other distributions, you need to install the packages if they are not installed or do not have the required versions.

Are the required packages already installed?

To check whether the packages are already installed, perform these steps:

    Run the following command to find out the kernel version and the required GCC version:

yum list installed | grep kernel-devel
dpkg --get-selections | grep linux-headers
dpkg --get-selections | grep linux-image

In either case, ensure that the package versions are the same as in Linux version in step 1.

yum list installed | grep elfutils-libelf-devel

Installing the packages from the repository

The following table lists how to install the required packages in various Linux distributions.

kernel-devel
gcc
make
elfutils-libelf-devel

Run the following command:

kernel-devel
gcc
make
elfutils-libelf-devel

Run the following command:

linux-headers
linux-image
gcc
make
perl

Run the following commands:

sudo apt-get update
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install linux-image-$(uname -r)
sudo apt-get install gcc-
sudo apt-get install make
sudo apt-get install perl

kernel-source
gcc
make
perl

sudo zypper install kernel-source
sudo zypper install gcc
sudo zypper install make
sudo zypper install perl

The packages will be downloaded from the distribution’s repository and installed.

For other Linux distributions, please refer to the distribution’s documentation regarding the exact names of the required packages and the ways to install them.

Installing the packages manually

You may need to install the packages manually if:

  • The machine does not have an active Red Hat subscription or Internet connection.
  • The setup program cannot find the kernel-devel or gcc version corresponding to the kernel version. If the available kernel-devel is more recent than your kernel, you need to either update the kernel or install the matching kernel-devel version manually.
  • You have the required packages on the local network and do not want to spend time for automatic search and downloading.

Obtain the packages from your local network or a trusted third-party website, and install them as follows:

Читайте также:  Изменить файл через консоль linux

    In Red Hat Enterprise Linux, CentOS, or Fedora, run the following command as the root user:

rpm -ivh PACKAGE_FILE1 PACKAGE_FILE2 PACKAGE_FILE3
sudo dpkg -i PACKAGE_FILE1 PACKAGE_FILE2 PACKAGE_FILE3

Example: Installing the packages manually in Fedora 14

Follow these steps to install the required packages in Fedora 14 on a 32-bit machine:

    Run the following command to determine the kernel version and the required GCC version:

Linux version 2.6.35.6-45.fc14.i686
gcc version 4.5.1
kernel-devel-2.6.35.6-45.fc14.i686.rpm
gcc-4.5.1-4.fc14.i686.rpm
rpm -ivh kernel-devel-2.6.35.6-45.fc14.i686.rpm
rpm -ivh gcc-4.5.1.fc14.i686.rpm
rpm -ivh make-3.82-3.fc14.i686

The topic was last revised: Saturday, October 31, 2020 7:36:31 PM

Web Help for Cyber Protection Version 20.10 .

Источник

Объясните простым языком, для чего нужен kernel-devel и почему Virtual Box без него не может нормально работать?

Как я понимаю, VBox как-то интегрируется в ядро, а kernel-devel нужен чтобы эту интеграцию осуществить?

Перемещено mono из talks

Это набор хедеров, которые нужны для сборки модулей ядра VirtualBox конкретно под твою версию ядра.

чтобы модули для ядра собрать

во многих дистрах все собрано и не нужны пользователю эти devel пакеты.

…в принципе, как и сам vbox…

Я же просил простым языком:) Что такое хедеры? Т.е. более низкоуровневое определение можно?

заголовочные файлы языка С

Это набор каких-то инструкций, правил по которым модули ядра собираются конкретно под мою версию ядра?

Это описания функций и данных, которые необходимы исходному коду ядра.

Модули VBox должны быть собраны под конкретное ядро. kernel-devel — исходники для сборки модулей ядра, которые требуются для такой сборки.

Поломался vbox? Не можешь установить? Не хватает linux-headers после apt-get upgrade?

А зачем вообще виртуалбоксу ядрёный модуль? Почему бы ему не работать через kvm?

Хотя бы потому, что KVM есть только под Линукс.

Потому, что согласно линакс-way «stable API is nonsense», а уж ABI — тем более, и поэтому, надо ломать его с каждой новой версией. Соответственно, для каждой версии ведра нужно собирать свои драйвера, и хорошо, если собирать, а не переписывать. Такое вот «defective by design».

thunar ★★★★★ ( 30.08.16 17:14:29 MSK )
Последнее исправление: thunar 30.08.16 17:18:17 MSK (всего исправлений: 4)

Немного другой вопрос

Почему вообще обязательно иметь kernel space шляпу для виртуализации, нельзя ли как-то обойтись юзерспейсом?

Сомневаюсь, что ядерный модуль линукса просто так скомпилируется, скажем, для windows, для него всё равно придётся писать отдельный драйвер

а какой у bochs перфоманс? Я недавно запускал qemu без драйверов на залоченной винде, там всё было очень печально, к сожалению 🙁

А это как вообще? Когда нельзя в ring0 ничего выполнить? Так это все ломается, было бы желание

Источник

What is kernel devel linux

Featured Image

Featured Image

Featured Image

Featured Image

Featured Image

Featured Image

Featured Image

Featured Image

Featured Image

Featured Image

What is kernel devel Linux?

The function of the kerneldevel package on Fedora is to provide the headers needed to compile modules for the kernel. If you do not need to compile a kernel module, you do not need this package.

Read rest of the answer. Hereof, what is kernel devel?

Kerneldevel — This package provides kernel headers and makefiles sufficient to build modules against the kernel package.

Also, where is kernel devel installed? On Debian, Ubuntu and their derivatives, all kernel header files can be found under /usr/src directory. You can check if the matching kernel headers for your kernel version are already installed on your system using the following command.

Читайте также:  Резервная копия файла линукс

Then, what is devel in Linux?

2. 56. The *-devel packages (usually called *-dev in Debian-based distributions) are usually all the files necessary to compile code against a given library. For running an application using the library libfoo only the actualy shared library file ( *. so.

What is Linux kernel headers?

Kernel headers are used to compile various kernel modules, such as the graphics card driver you are trying to install. Like other header files in source code, kernel headers declare various functions, variables and data structures, in this case the API provided by the Linux kernel.

Источник

what is the linux-kernel-devel equivalent in 12.04.2 LTS 3.5.0?

What do you expect the package linux-kernel-devel to do? Are you looking for the headers, or something else?

4 Answers 4

Executive Summary

You probably want to install the package called linux-headers-generic .

If running uname -r gives you something other than generic after the version number, substitute that for generic in linux-headers-generic . (This might be server or generic-pae on some installations of some Ubuntu releases, and there are a few other occasional kernel «flavors.»)

Since you most likely needs this so that you can build a driver (which might be automated, you might not be «building it yourself»), it’s a good idea to install build-essential too to make it so you’ll probably have all the necessary tools.

Full Explanation

To the best of my knowledge, no operating system has a package called Linux-kernel-devel . This is for two reasons:

  • Package names starting with capital letters are extremely rare, for any Unix-like OS.
  • GNU/Linux operating systems typically name their kernel-related packages so that the names contain the word kernel or the word linux, but not both. (On Ubuntu, it’s the word linux.)

It’s common for kernel-related packages on systems that use the Red Hat Package Manager ( rpm ) and related utilities to have kernel in the name of their packages. For example, Mageia has a number of packages whose names start with kernel and end in devel . These packages almost always (on Mageia and any OS that has them) provide the header files needed to build drivers from source for use with the kernel. They may also provide related utilities to facilitate. These packages:

  • do not provide the full source code of the kernel. That’s provided by other packages.
  • do not provide a pre-compiled, usable kernel. That’s provided by other packages.
  • do not provide a compiler or most other purpose build tools. Those, too, are provided by other packages.

In Ubuntu, as can be seen in the list here, the packages that provide kernel headers have names that start with linux-headers . Usually the correct package to install is linux-headers-generic . However, to be sure of what package to install to get headers that correspond to your currently running kernel, run:

You’ll get output that looks something like:

That is, you’ll have a version number (which will include . characters and usually at least one — ), followed by a — , followed by one or more words indicating which kind of kernel you are running.

Читайте также:  Intel processors linux driver

If you just want the headers for the specific version you happen to be running now, you could install the package whose name is linux-headers-* where * is replaced by the full output of uname -r . For example, on my system, I could run:

sudo apt-get update && sudo apt-get install linux-headers-3.5.0-36-generic 
sudo apt-get update && sudo apt-get install linux-headers-`uname -r` 

These approaches are equivalent, but they are not usually the best way to go.

Instead, you usually will want to install the metapackage that always provides the newest kernel headers as an update (by perpetually depending on whatever header package is newest). This parallels the way your compiled, running kernel is installed and gets updated. To do that, look just at the part of uname -r ‘s output after the version number. That is, if uname -r gives you 3.5.0-36-generic , take just the generic part.

Then install the package called linux-headers-* where * is replaced by that part. So, on my system, it would be linux-headers-generic and one way I could install it would be to run:

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

For most people it is linux-headers-generic , but depending on what Ubuntu release you’re running, what architecture and type of device you’re running it on, and how it is installed and configured, other possibilities include generic-pae , highbank , omap , server , and virtual .

Header files facilitate developing and compiling/building software that uses facilities provided by the software whose header files are being used. The most common reason you might need kernel headers is if you are going to build a driver (a kernel module) from source code. Some applications, like VMware and VirtualBox, will sometimes require this, and will automate the build themselves.

In addition to header files, to build software a compiler and other tools are needed. To maximize the likelihood that you have the necessary tools, it’s a good idea to install the build-essential package also.

It’s uncommon for anyone to need the actual full kernel source code (unless, of course, you’re planning on building your kernel from source). But if you do need that, you’ll have to install another package too. In Ubuntu the package for full kernel source code is called linux-source . (This is in keeping with the Debian/Ubuntu convention of naming packages that provide substantive parts of the Linux kernel linux rather than kernel .)

If You Still Have Trouble

If you try to install any of these packages but experience problems, and you want help, then you will have to include the complete and exact text from the Terminal, including the lines where you typed commands. The best way to provide this is by editing your question, but if it is too long, you can paste it somewhere like http://paste.ubuntu.com and provide us with the URL where we can access it.

If you comment on this question, I’ll be notified. You can edit your question and also comment here to call attention to the information you’ve provided in your question. (Important information is best kept in questions and answers.) Good luck!

Источник

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