In this post we will see how to check all available kernel version in Linux Ubuntu and how to check last patch date in Ubuntu Systems.
Check All Available Kernel Version In Linux Ubuntu
‘uname’ prints information about the machine and operating system it is run on. If no options are given, ‘uname’ acts as if the ‘-s’ option were given.
The three uname comamnds to know about Linux Kernel are “uname -r” “uname -v” and “uname -s”.
- The “uname -r” prints the kernel release.
- The command “uname -s” prints the kernel name.
- The command “uname -v” prints the kernel version.
NOTE: The kernel name might be the same as the operating system name printed by the ‘-o’ or ‘–operating-system’ option, but it might differ. Some operating systems (e.g., FreeBSD, HP-UX) have the same name as their underlying kernels; others (e.g., GNU/Linux, Solaris) do not.
Using the info containes in /proc/version file is another way to check kernel version in Linux Ubuntu. The /proc/version file specifies the version of the Linux kernel, the version of gcc used to compile the kernel, and the time of kernel compilation. It also contains the kernel compiler’s user name (in parentheses).
Of all the commands available there, using the command uname -a is easier and helpful. It wil show all the information about the kernel including the date of update and installation.
How To Check All Available Kernel Version In Linux
By default, all installed Linux Kernels and their associated files are stored under /boot directory named vmlinuz. To check all available Kernel version in Linux, run one of the following commands:
find /boot/vmli*
dpkg --list | grep linux-image
sudo dpkg ––list | egrep –i ––color ‘linux-image|linux-headers’
sudo dpkg ––list | egrep –i ––color ‘linux-image|linux-headers’ | wc –l
If you want to list all installed kernels on Ubuntu except current one, run the command:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
If you want to print the name of the kernel currently being used and the date of installation and update, run the uname command with -sv options.
How To Check Last Patch Date In Ubuntu
In Ubuntu Linux systems, you can easily check the last patch date using tails command. The /var/log/dpkg.log file keeps track about all the changes made in the packages including kernel operations.
Simply run the following command to see the last packages info:
sudo tail -f /var/log/dpkg.log
The tail command is used to printt the last part (10 lines by default) of each FILE specified with its command.
To view all info, run the following command:
sudo less /var/log/dpkg.log
sudo more /var/log/dpkg.log
You can also use the command “sudo ls -l /var/log/dpkg.log*” to view list of all files.