[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Checking for kernel freshness

Bernhard Schmidt wrote:
> The hard part seems to be matching the running kernel against the
> version installed. I cannot figure out a good way so far. Nothing in the
> running kernel seems to show the Debian version (i.e.
> 2.6.32-41squeeze2), thus I cannot compare it. It is printed in the
> bootup messages

Try this:

  $ cat /proc/version
  Linux version 2.6.32-5-686 (Debian 2.6.32-41squeeze2) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Mar 26 05:20:33 UTC 2012

  $ perl -lne '$_ =~ m/Linux version (\S+-\S+)/ && print "linux-image-", $1;' /proc/version

  $ dpkg --status linux-image-2.6.32-5-686 | awk '/^Version:/{print$2}'


Attachment: signature.asc
Description: Digital signature

Reply to: