LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How to determine which kernel version I'm using? (https://www.linuxquestions.org/questions/debian-26/how-to-determine-which-kernel-version-im-using-620852/)

Deerslayer 02-13-2008 10:48 AM

How to determine which kernel version I'm using?
 
Last night, I did a dist-upgrade, which installed Linux version 2.6.18.dfsg.1-18etch1. This version fixed a vulnerability (DSA-1494-2) which had been reported on Feb 11. Then when I looked at the latest vmlinuz, the datestamp was Feb. 10.

I looked for a command to display the kernel version, and all I could find was uname, which just reports "Linux debian 2.6.18-6-686." Is there another command that will report the exact version number, or is there some other way to find it?

pljvaldez 02-13-2008 11:01 AM

You can try dpkg -L | grep linux-image and see if that tells you the exact package.

druuna 02-13-2008 11:03 AM

Hi,

uname -vr will show you the kernel version (-v) and it's release (-r)

Example:
Quote:

$ uname -vr
2.6.22.druuna #1 SMP Sat Aug 4 19:06:45 CEST 2007
blue -> -v
green -> -r

Hope this helps.

TheSmilingBandit 02-13-2008 11:13 AM

Actualy, this is a little bit offtopic, but: how can I determine, which IP adresse my dhcp router gave me during the current session? Guess this might be as easy as asking for the kernel version...

Deerslayer 02-13-2008 11:21 AM

Quote:

Originally Posted by pljvaldez (Post 3055812)
You can try dpkg -L | grep linux-image and see if that tells you the exact package.

Hmm, I tried this and the response was "dpkg-query: --listfiles needs at least one package name argument." I then tried dkpg -L linux-image (yeah, I'm just guessing at this point) and it said that linux-image is not installed.

Deerslayer 02-13-2008 11:25 AM

Quote:

Originally Posted by druuna (Post 3055815)
Hi,

uname -vr will show you the kernel version (-v) and it's release (-r)

Example:

blue -> -v
green -> -r

Hope this helps.

This seems to show a subset of the info from uname -a. What I need is the part in red: 2.6.18.dfsg.1-18etch1. I think the version that I had before the dist-upgrade was 1-16etch1, IIRC from watching the latest one install.

druuna 02-13-2008 11:46 AM

Hi,

The output of uname -r (which is indeed a subset of -a) shows this (my kernel):

2.6.22.druuna

The part in blue is what you are highlighting, but this is something that can be set during kernel compilation and not all people put the correct/complete info there. If this is the case then there is no command to check the actual build.

You could check to see if the appropriate kernel is booted (check grub or lilo file) and also check what is present in /boot (new kernel should be present, older kernels could be present).

druuna 02-13-2008 11:49 AM

Hi,

Quote:

Originally Posted by TheSmilingBandit (Post 3055826)
Actualy, this is a little bit offtopic, but: how can I determine, which IP adresse my dhcp router gave me during the current session? Guess this might be as easy as asking for the kernel version...

This is indeed (very) off topic. Please search the forum and google first and if that doesn't help start a seperate thread. BTW: Take a look at the ifconfig command ;)

pljvaldez 02-13-2008 12:24 PM

Quote:

Originally Posted by Deerslayer (Post 3055830)
Hmm, I tried this and the response was "dpkg-query: --listfiles needs at least one package name argument." I then tried dkpg -L linux-image (yeah, I'm just guessing at this point) and it said that linux-image is not installed.

You probably have to do dpkg -L 'linux*' instead. Sorry my first command didn't work, I'm not at my debian box... :D

TheSmilingBandit 02-13-2008 01:12 PM

Quote:

Originally Posted by druuna (Post 3055857)
Hi,



This is indeed (very) off topic. Please search the forum and google first and if that doesn't help start a seperate thread. BTW: Take a look at the ifconfig command ;)

Sy for getting offtopic, my post can be deleted, if nessecary. It is ifconfig -a in case someone want to know. Thought it might somehow fit into this, sorry again ;)

Deerslayer 02-13-2008 02:00 PM

Quote:

Originally Posted by druuna (Post 3055854)
Hi,

The output of uname -r (which is indeed a subset of -a) shows this (my kernel):

2.6.22.druuna

The part in blue is what you are highlighting, but this is something that can be set during kernel compilation and not all people put the correct/complete info there. If this is the case then there is no command to check the actual build.

You could check to see if the appropriate kernel is booted (check grub or lilo file) and also check what is present in /boot (new kernel should be present, older kernels could be present).

From uname, the part of the name of my kernel that seems to correspond to 'druuna' in your kernel is '-6-686'. This is unchanged from the kernel I had before the dist-upgrade. There are two kernels in /boot, the other being '-5-686', and both are available from grub. That all looks OK, but I was hoping that there was some way to determine the exact build... certainly Debian puts that in there somewhere?

The only thing that seems odd is the datestamp. Since the notification on debian.org said that the .1-18etch1 kernel fixed a vulnerability that was reported on Feb 11, and aptitude seemed to install the new kernel OK, I don't understand why the datestamp on the newest kernel is Feb 10. I probably don't have anything to worry about, but now that I started this I want to see it through.

pljvaldez 02-13-2008 03:17 PM

I just had a thought, maybe you can check the kernel config file in /boot. Just read through it with more as the relevant information should be near the top of the config file.

Telemachos 02-13-2008 03:25 PM

What about this (untested, since I'm not at my Debian machine)?
Code:

apt-cache policy linux-image-`uname -r`

farslayer 02-13-2008 03:39 PM

that should be a direct hit..

Code:

it-etch:~# apt-cache policy linux-image-`uname -r`

linux-image-2.6.18-6-686:
  Installed: 2.6.18.dfsg.1-18etch1
  Candidate: 2.6.18.dfsg.1-18etch1
  Version table:
 *** 2.6.18.dfsg.1-18etch1 0
        500 http://security.debian.org etch/updates/main Packages
        100 /var/lib/dpkg/status


Dutch Master 02-13-2008 03:42 PM

You got caught with the way Debian allows you to keep your system up to date: it has a general linux-image package, which depends on the latest available kernelpackage. In my case, it's called 'linux-image-amd64' as I have 64 bit AMD hardware (and 64 bit Debian Etch system). Yours could be like 'linux-image-6-686' or something similar.

I suggest to start Synaptic or aptitude and enter 'linux-image' as a search string. Look around in the results, the packages installed will show up. (use the n key in aptitude to cycle through the results)

Btw, you did update the package list first, did you? ;) Click on 'reload' in Synaptic or press u in aptitude. Then click 'mark all upgrades' in Synaptic or U (yes, capital u) in aptitude to check for updates. In Synaptic, click 'apply' or in aptitude: press g twice. Now your system updates itself :) (I know you'll probably already know this, but new users probably not ;))


All times are GMT -5. The time now is 05:50 AM.