1

In a Linux distro, let's say Ubuntu 14.04, how can one find the time and date when this particular Linux Kernel was compiled/built?

5

On Ubuntu, any other Linux distribution, and many other UNIX-based systems, you can use uname to find this information. You want uname -v for "kernel version information":

$ uname -v
#838 SMP Tue Feb 9 13:15:09 GMT 2016

$ uname -v
Darwin Kernel Version 14.5.0: Tue Sep  1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64

$ uname -v
FreeBSD 10.2-RELEASE-p9 #0: Thu Jan 14 01:32:46 UTC 2016     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC

Note that not all POSIX systems will show a build date as part of this output, or via uname at all (but Linux, BSD, and Mac OS will!).

The datestamp shown is the date/time when the kernel was compiled.

On Linux, you can also do:

$ cat /proc/version
Linux version 4.2.0-27-generic (buildd@lgw01-12) (gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2) ) #32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016

Based on discussion in the comments, and just to add additional information for others who may stumble across this, here's how to get this information on a few other POSIX operating systems:

AIX

Use the oslevel command to display the AIX version, release, Technology Level (TL), Service Pack (SP) and build date. For example, this output shows AIX V6.1 Technology Level 8, Service Pack 1, built in the 45th week of 2012:

sh> oslevel -s
6100-08-01-1245

Solaris

On Solaris, I can't figure out a proper way to get a true compile date, but you can get the packaging date for the kernel (when the package was built) via pkg info kernel:

# pkg info kernel
          Name: system/kernel
       Summary: Core Kernel
   Description: Core operating system kernel, device drivers and other modules.
      Category: System/Core
         State: Installed
     Publisher: solaris
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.175.0.2.0.2.1
Packaging Date: Wed Oct 19 07:57:11 2011
          Size: 17.99 MB
          FMRI: pkg://solaris/system/kernel@0.5.11,5.11-0.175.0.2.0.2.1:
                20111128T20503

HP-UX

This one seem a bit tricker. You can get the link date (build date) of the kernel via:

echo "linkstamp?s" | adb /stand/vmunix

Or even:

ls -l /stand/vmunix
  • I checked Solaris, AIX, HPUX, none behave as indicated. Ditto for Debian 7. – Thomas Dickey Feb 22 '16 at 1:20
  • @ThomasDickey - the output varies... You won't get the build date on those dinosaurs but you should get it on Debian. – don_crissti Feb 22 '16 at 1:41
  • @ThomasDickey Updated my answer to cover the systems listed. uname -v works fine for me on Debian 6 and Debian 8. I don't have a Debian 7 system to play with--are you sure? uname -r doesn't work on Debian 7? Either way, OP's question was about Ubuntu 14.04, so I've answered his question, and I also adjusted the language as to not imply this will work on any POSIX system. – Will Feb 22 '16 at 1:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.