LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-15-2007, 05:29 PM   #1
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Rep: Reputation: 33
Do I need to install linux-headers?


I need to recompile my kernel. If I install a new linux-image from the Debian repository will I need to install the corresponding linux-header package as well?
 
Old 08-15-2007, 05:33 PM   #2
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Quote:
Originally Posted by mikieboy View Post
I need to recompile my kernel. If I install a new linux-image from the Debian repository will I need to install the corresponding linux-header package as well?
I have always got varied answers for this question. Personally even I would also like to know what is the answer. My guess is that if you are going to do some development work (driver writing) then you will require those..

People can correct me if I am completely off the topic..
 
Old 08-15-2007, 05:51 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
The kernel headers are only needed when you're using a stock kernel and you want to compile a new driver module or such that links directly with the kernel. This is because the distro maintainers deliberately separate the kernel and its headers into separate packages.

If you compile your own kernel from source then you do not need to worry about headers because they are created and installed by the default compiling process.

Note also that the "linux-image" packages are the pre-compiled stock kernels. If you want to compile your own you'll need to install one of the "linux-source" packages (which basically just deposits a source tarball into /usr/src), or get the latest source from kernel.org or something.
 
Old 08-15-2007, 06:06 PM   #4
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Original Poster
Rep: Reputation: 33
Thanks. My reason for asking is that I am going to compile a new all-in-one printer driver. So have I got this right? I need to install a linux-source package but not the corresponding linux-header package.
 
Old 08-15-2007, 06:12 PM   #5
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Original Poster
Rep: Reputation: 33
Can someone point me to a Debian kernel compilation guide that is reasonably up to date ( I can only find oldish ones)?

Thanks

Last edited by mikieboy; 08-15-2007 at 06:18 PM.
 
Old 08-15-2007, 06:44 PM   #6
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by mikieboy View Post
Can someone point me to a Debian kernel compilation guide that is reasonably up to date ( I can only find oldish ones)?

Thanks
http://newbiedoc.sourceforge.net/system/kernel-pkg.html

That is still "old" but none the less the steps are the same for compiling a kernel today you need to configure the source tree via the make menuconfig or whichever of the graphical frontends that can be used. You of course need to know what the hardware is in your machine so that you pick the correct modules to compile to have support for everything available. Just what support do you need so you have to compile your own kernel anyways?
 
Old 08-15-2007, 06:52 PM   #7
HowDoIProgramIt
Member
 
Registered: Nov 2006
Location: East Coast, USA (in "the great northeast")
Distribution: Custom / from source; Fedora, Debian, CentOS, Scientific; LFS.
Posts: 94

Rep: Reputation: 15
Quote:
Originally Posted by mikieboy View Post
I need to recompile my kernel. If I install a new linux-image from the Debian repository will I need to install the corresponding linux-header package as well?
I'm not exactly sure which you're asking; are you going to recompile the kernel or just grab another .deb from somewhere and install it?

The answer, either way, to "if I replace my kernel with a different version, do I need to replace the kernel headers too" is "yes". You need them (the headers) for a number of reasons; one of the more common is for building kernel modules out-of-tree.

If you're going to compile your own kernel, then you're probably going to create a linux-headers package at the same time you create your linux-kernel package. You have to install them separately, but you can build them at the same time.

Are you trying to use a kernel from a different release (for example, an "unstable" kernel on "etch" ("stable")), or ??? Or are you getting the kernel from backports.org or another 3rd party repository?

Like I said, I'm not completely clear on what it is that you're trying to do...
 
Old 08-15-2007, 06:57 PM   #8
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Original Poster
Rep: Reputation: 33
My old printer was a parallel port Epson and my new HP one is USB. My existing kernel doesn't seem to have USB printer support enabled as I get a "no device found" message when I try to use the printer with the generic driver. At least I think that's the problem, only one way to find out!

I also need to compile the latest HPLIP printer driver if I want full support for all the printer's features as the debian HPLIP driver doesn't support this latest model. The new driver is available from HP but as a tarball not a .deb.
 
Old 08-15-2007, 07:57 PM   #9
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by mikieboy View Post
My old printer was a parallel port Epson and my new HP one is USB. My existing kernel doesn't seem to have USB printer support enabled as I get a "no device found" message when I try to use the printer with the generic driver. At least I think that's the problem, only one way to find out!
No probably several.

Code:
grep -i printer /boot/config-2.6.22.1-cfs-v19
CONFIG_PRINTER=m
CONFIG_USB_PRINTER=m
Try running the command using your config-??? to see what it says and you might want to try it for hiddev although I can't see them having left that out as it is needed for a lot of things connect to a USB port.
Quote:
I also need to compile the latest HPLIP printer driver if I want full support for all the printer's features as the debian HPLIP driver doesn't support this latest model. The new driver is available from HP but as a tarball not a .deb.
I can see you needing to do do that for it to work properly then. Have you looked at the output of the dmesg command after having plugged in the printer to the usb port to see if it is detected?
 
Old 08-15-2007, 08:33 PM   #10
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,440
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
The version of the kernel headers package which should be present on your machine is the version which was installed at the same time as your glibc package.

You shouldn't upgrade either glibc or linux-headers without also upgrading the other at the same time.

Linus says it best: "The fact is, that the header files should match the library you link against, not the kernel you run on." Link
 
Old 08-15-2007, 08:58 PM   #11
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by rkelsen View Post
The version of the kernel headers package which should be present on your machine is the version which was installed at the same time as your glibc package.

You shouldn't upgrade either glibc or linux-headers without also upgrading the other at the same time.

Linus says it best: "The fact is, that the header files should match the library you link against, not the kernel you run on." Link
Well thats all well and good if that was the actual header files being discussed here what you speak of is the linux-libc-dev package. The ones in question for this purpose would be linux-headers-2.6.???? with the ???? matching the running kernel so you can build kernel modules against them then module will match the running kernel when modprobe'd, although I doubt the OP even needs any of these headers files for when he tries compile the HPLIP driver probably will need the cups development packages.

Code:
acsh linux-libc-dev
Package: linux-libc-dev
Priority: optional
Section: devel
Installed-Size: 4040
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Architecture: amd64
Source: linux-2.6
Version: 2.6.22-3
Replaces: linux-kernel-headers
Provides: linux-kernel-headers
Conflicts: linux-kernel-headers
Filename: pool/main/l/linux-2.6/linux-libc-dev_2.6.22-3_amd64.deb
Size: 698506
MD5sum: 0c9963f7115c626702953032352f5e49
SHA1: 66ab13424a87d9cf052131a504805a048d7491e1
SHA256: 043527ac81eabda1857c693ce0bf3fccccb92c8b5b5b3e14c7aba35fe012c5e0
Description: Linux Kernel Headers for development
 This package provides headers from the Linux kernel.  These headers are
 used by the installed headers for GNU glibc and other system libraries.
 
Old 08-15-2007, 09:46 PM   #12
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,440
Blog Entries: 7

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
Originally Posted by HappyTux View Post
Well thats all well and good if that was the actual header files being discussed here what you speak of is the linux-libc-dev package. The ones in question for this purpose would be linux-headers-2.6.????
In that case both the linux-libc-dev headers and the linux-headers-2.6 should match the glibc version.

See:
Code:
Package: linux-libc-dev
..
These headers are used by the installed headers for GNU glibc and other system libraries.
 
Old 08-16-2007, 02:14 AM   #13
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by rkelsen View Post
In that case both the linux-libc-dev headers and the linux-headers-2.6 should match the glibc version.

See:
Code:
Package: linux-libc-dev
..
These headers are used by the installed headers for GNU glibc and other system libraries.
I fail to see what point you are trying to make here the likelyhood of something like that happening on a Debian system are next to nil if using it properly. In order to get in that situation you would need to force the install of a package on a branch of Debian it was not built for or get caught in the middle of a libc6 (glibc on Debian) transition from unstable down to testing or mixing stable with testing/unstable. Anyways we are filling up buddies thread with this when it is not relevant to the problem at hand...
 
Old 08-16-2007, 07:59 AM   #14
mikieboy
Member
 
Registered: Apr 2004
Location: Warrington, Cheshire, UK
Distribution: Linux Mint 19.1 Xfce
Posts: 555

Original Poster
Rep: Reputation: 33
I couldn't find any instance of linux-headers installed on my system. Maybe my (very recent) upgrade from Etch to Lenny could be responsible for anything that's gone missing. Could the lack of headers cause the "no device found" message? BTW I'm running the Debian 2.6.21-2-k7 linux-image.
I'm afraid the glibc discussion has gone a bit over my head. Wouldn't "apt-get dist-upgrade" have sorted dependencies out?
 
Old 08-16-2007, 09:08 AM   #15
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by mikieboy View Post
I couldn't find any instance of linux-headers installed on my system. Maybe my (very recent) upgrade from Etch to Lenny could be responsible for anything that's gone missing. Could the lack of headers cause the "no device found" message? BTW I'm running the Debian 2.6.21-2-k7 linux-image.
I'm afraid the glibc discussion has gone a bit over my head. Wouldn't "apt-get dist-upgrade" have sorted dependencies out?
No if you never went out of your way to install the headers then they would not have been there to start with. Have you checked with the dmesg command to see if it is detected during boot/after you turn it on like I suggested? If so and it is seen then it most likely is the case that you need the new hplip driver compiled for your install. Also do you have a URL for the location of this new driver and since you do not mention what is the model number of the printer?
 
  


Reply

Tags
kernel headers


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
install linux headers of a compiled kernel mariogarcia Debian 5 04-18-2007 06:23 PM
Install Kernel Headers derrekito Slackware 10 06-28-2006 05:47 AM
Unable to compile (make, make install):need linux-headers smiley_lauf Linux - Newbie 3 01-31-2006 12:05 AM
I need to know how to install my headers. Jazzmantrp4 Linux - Newbie 1 01-16-2006 05:57 PM
gcc compiler error / linux headers install help SciYro Linux - Software 2 12-07-2003 01:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration