LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2017, 08:07 AM   #1
userAC
LQ Newbie
 
Registered: Feb 2017
Posts: 4

Rep: Reputation: Disabled
Determine active kernel package version on machine with multiple versions


I have been doing some research and as far as I know, it's possible to have multiple versions of kernel and other kernel packages and to know the version of the active running kernel, the uname command can be used. But how about the other kernel packages like kernel-devel? I have listed some of my questions below.

1. When the kernel is installed or updated, does the other kernel packages like kernel-devel or kernel-headers also installed or updated with the same version like the kernel?

2. If multiple versions of kernel packages exists like the kernel-devel, does it latest version automatically becomes the active? If not, is there a way to know what version is active or running?

Thank you in advance.
 
Old 02-15-2017, 03:55 PM   #2
pandanuma
Member
 
Registered: May 2005
Location: greatwhitenorth
Distribution: deb99
Posts: 114
Blog Entries: 9

Rep: Reputation: 36
a quick search of the interweb [mint find which kernel] lead me to hear...

https://www.linux.com/learn/how-find...why-it-matters
scroll down and see if dpkg -l k* might help

this link also has some answers for you...
http://unix.stackexchange.com/questi...ackages/345207

the 'similar threads' at the bottom of your thread might be good to check out also...
 
Old 02-15-2017, 04:24 PM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Current: Debian and OpenSUSE. Past: Arch, RedHat (pre-RHEL). FreeBSD & OpenBSD novice, Hackintosh
Posts: 1,193
Blog Entries: 7

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by userAC View Post
I have been doing some research and as far as I know, it's possible to have multiple versions of kernel and other kernel packages and to know the version of the active running kernel, the uname command can be used. But how about the other kernel packages like kernel-devel? I have listed some of my questions below.

1. When the kernel is installed or updated, does the other kernel packages like kernel-devel or kernel-headers also installed or updated with the same version like the kernel?

2. If multiple versions of kernel packages exists like the kernel-devel, does it latest version automatically becomes the active? If not, is there a way to know what version is active or running?

Thank you in advance.
You give no information, so an answer here is not possible. Different distributions do things differently. What distribution are you running?

In Debian, the appropriate devel packages may or may not be updated, depending on how you installed the kernel in the first place.
 
Old 02-15-2017, 04:43 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,593

Rep: Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509Reputation: 3509
Emphasises why it isn't a great idea to post in several places - whether here or elsewhere.
Conflicting - not necessarily wrong - answers are likely to continue the confusion.
 
Old 02-16-2017, 12:37 AM   #5
userAC
LQ Newbie
 
Registered: Feb 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
my apologies for not giving enough information and for posting in two different places. I'm just trying to find answers from people who are much more experienced in linux than I am. By the way, I'm referring to red hat enterprise linux. I have also looked at the 'similar threads' below, however I didn't find the answer I am looking for..and just one last question, is there a way to see or to know what is the running version of the other kernel packages like kernel-devel? I know uname shows the running version of the kernel and rpm -qa able to list it, but is there a command that shows the running version of the other kernel packages?
 
Old 02-16-2017, 05:05 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915Reputation: 2915
I don't know much about these things, but as far as I am aware, the other packages such as kernel-headers and kernel-devel are not "running" as such on your machine. You may have various versions of these installed, and if you carry out an action such as compiling kernel modules, the packages that match the current running kernel are brought into play i.e. used (unless of course you specify otherwise).

It very much depends on the system, and technique used on that system, whether or not the headers etc. are installed when you install and/or use a new kernel. For Red Hat, searching on the web for "Red Hat upgrading kernel" produces, for example, the following links:

https://access.redhat.com/documentat...he_Kernel.html

https://access.redhat.com/solutions/20366
 
Old 02-16-2017, 07:38 AM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
not to sound silly but doesn't running 'uname' find the version of the running kernel which can then be compared against the package manager to see if the headers are installed properly?
 
Old 02-17-2017, 11:03 AM   #8
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Current: Debian and OpenSUSE. Past: Arch, RedHat (pre-RHEL). FreeBSD & OpenBSD novice, Hackintosh
Posts: 1,193
Blog Entries: 7

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by frieza View Post
not to sound silly but doesn't running 'uname' find the version of the running kernel which can then be compared against the package manager to see if the headers are installed properly?
Exactly how I'd do it, but as we have no info on the distribution, etc, there's no way to give the OP a direct answer.

On debian, for example,
Code:
anthony**~**dpkg -l "linux-*-$(uname -r)"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  linux-headers- 4.9.6-3      amd64        Header files for Linux 4.9.0-1-am
ii  linux-image-4. 4.9.6-3      amd64        Linux 4.9 for 64-bit PCs (signed)
 
Old 02-17-2017, 02:51 PM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://www.tecmint.com/useful-basic-...ge-management/
http://www.binarytides.com/apt-get-t...u-commandline/

Enjoy the goodness.
 
Old 02-18-2017, 05:12 PM   #10
coltree
Member
 
Registered: Nov 2003
Location: Jacobs Well, Queensland AU
Distribution: OpenBSD
Posts: 96
Blog Entries: 1

Rep: Reputation: 31
1. If you have compiled modules separately from the source tree
you will need to recompile each module against the new kernel version,
and place the special module(s) in /lib/modules/(new-kernel-version)/kernel/drivers/.../driver.ko

I usually have source trees in /usr/src with a symlink to the currently used source tree
e.g.
old source tree/usr/src/4.1.40
/usr/src/linux -> 4.1.40

new source tree /usr/src/4.1.42

ln -sfnv /usr/src/4.1.42 /usr/src/linux

/usr/src/linux -> 4.1.42

headers are in the source tree and devel looks at /usr/src/linux (not 4.1.42)


2. In the good old days of lilo boot loader,
you would add a new bootable image and label to choose from,
and select from the lilo boot menu
and once you are happy your new kernel works, make it default.
You can do a similar thing with grub.

and you know about uname -a and /proc/version, etc

I'm actually really lazy and do much of this fiddly file stuff in mc (midnight commander)
(any new system)
apt-get update
apt-get install mc
apt-get upgrade

Last edited by coltree; 02-18-2017 at 06:05 PM. Reason: bit more detail
 
1 members found this post helpful.
Old 02-20-2017, 12:49 AM   #11
userAC
LQ Newbie
 
Registered: Feb 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by goumba View Post
Exactly how I'd do it, but as we have no info on the distribution, etc, there's no way to give the OP a direct answer.

On debian, for example,
Code:
anthony**~**dpkg -l "linux-*-$(uname -r)"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  linux-headers- 4.9.6-3      amd64        Header files for Linux 4.9.0-1-am
ii  linux-image-4. 4.9.6-3      amd64        Linux 4.9 for 64-bit PCs (signed)
my apologies, was referring to red hat distribution. is this also appilcable to red hat distro? thank you in advance.
 
Old 02-20-2017, 12:54 AM   #12
userAC
LQ Newbie
 
Registered: Feb 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by goumba View Post
You give no information, so an answer here is not possible. Different distributions do things differently. What distribution are you running?

In Debian, the appropriate devel packages may or may not be updated, depending on how you installed the kernel in the first place.
was referring to red hat distribution..
 
Old 02-20-2017, 02:28 AM   #13
coltree
Member
 
Registered: Nov 2003
Location: Jacobs Well, Queensland AU
Distribution: OpenBSD
Posts: 96
Blog Entries: 1

Rep: Reputation: 31
referring to Redhat....
a little while since looking at RH. but things are basically in the same places.
my last bit of apt-getting was separate to your 2 questions, mc is a useful utility for looking around and making changes

another place to look is /lib/modules/version (e.g. 4.1.42)
inside you'll find two simlinks build and source which tie the particular kernel modules back to the relevant source/headers tree
you'll find the modules (drivers, etc) in /lib/modules/version/kernel/........

in /boot you'll see the compiled kernels, e.g. vmlinuz-generic-4.1.42
and the config file which says what was compiled in each kernel/modules version
not sure about RH, might also be an initrd file in /boot which is the first file loaded when booting

your boot program, lilo or grub, etc can select from multiple kernels available in /boot

Last edited by coltree; 02-20-2017 at 02:30 AM.
 
1 members found this post helpful.
Old 02-20-2017, 02:53 AM   #14
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,272

Rep: Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462Reputation: 5462
yes, see post #7, uname should work. also see man uname about usage
 
Old 03-01-2017, 08:05 AM   #15
cesarbergara
Member
 
Registered: Feb 2012
Location: Buenos Aires, Argentina
Distribution: Debian, Suse, Mandrake,
Posts: 73

Rep: Reputation: Disabled
Hi. Kernel, modules and sources is a good idea to install manually and no use dpkg, apt-get, rpm or other soft. You can download source tarball and extract it under /usr/src . Then you can compile it or patch it and install new kernel and modules (it is easy job). When you use 'uname -a ' OS give to you name and version of running kernel, then you can look under '/lib/modules' for modules version, and under '/usr/src' for sources.
It is a simple way to use and to control kernel and compiled kernels (better than install with package tools, which only can install/work only one version).
If you wish to compile a software and need to use kernel sources, you can put in the software './configures' options the kernel source directory.
Have a nice day
 
  


Reply


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
[SOLVED] multiple versions of GLIBC on target machine allagar Linux - Embedded & Single-board computer 1 02-25-2015 09:39 AM
Installing multiple rpm package versions? metal_militia Linux - Newbie 5 08-19-2014 01:29 PM
How to install multiple versions of package? terry-duell Fedora 10 10-01-2010 02:53 PM
Unable boot multiple kernel versions off of Redhat machine liangjz Linux - Newbie 3 03-16-2004 10:01 AM
Do multiple versions of Apache on one machine affect each other? mlhammer Linux - Software 0 11-28-2003 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:42 AM.

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