How to check Ubuntu version
To check the version of Ubuntu you’re running, you can use one of the following commands:
1. Using lsb_release
command
This is the standard way:
lsb_release -a
Output example:
yamlCopy codeNo LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
2. Using /etc/os-release
file
This file contains information about your operating system:
cat /etc/os-release
Output example:
makefileCopy codeNAME="Ubuntu"
VERSION="22.04 LTS (Jammy Jellyfish)"
ID=ubuntu
ID_LIKE=debian
VERSION_ID="22.04"
3. Using hostnamectl
This command provides additional system information:
hostnamectl
Output example:
Operating System: Ubuntu 22.04 LTS
Kernel: Linux 5.15.0-76-generic
4. Using uname
(for kernel version)
If you just need the kernel version:
uname -r
Output example:
5.15.0-76-generic
Choose any method based on your preference!