The fastest way to check your Linux version
Open a terminal window and type lsb_release -a, then press Enter. This command shows your Linux distribution name, release number, and codename in three lines. It works on most distributions — Ubuntu, Debian, Linux Mint, Fedora, and others — because they all include the lsb_release tool by default.
If that command does not work or shows "command not found", your system may use a different method. The next sections cover the alternatives that work when lsb_release is not available.
Key Takeaways
- The lsb_release -a command shows your distribution name and version number in most Linux systems.
- If lsb_release does not work, check the /etc/os-release file by typing cat /etc/os-release to see the same information in a different format.
- The uname -a command shows your kernel version, which is different from your distribution version but useful to know.
- Some older systems use /etc/lsb-release or distribution-specific files like /etc/debian_version when standard tools are missing.
Using /etc/os-release when lsb_release is not available
Type cat /etc/os-release and press Enter. This reads a text file that every modern Linux system stores in the same place. The output shows NAME (your distribution), VERSION (the release number), VERSION_ID (the numeric version), and PRETTY_NAME (a human-readable combination of both).
This method works on nearly all distributions made in the last five years, including Ubuntu, Fedora, CentOS, Rocky Linux, and Arch Linux. The file format is the same across all of them, so you do not need to remember different commands for different systems.
Checking your kernel version with uname
Type uname -a and press Enter. This shows your kernel version — the core software that runs your hardware — separate from your distribution version. You will see output like "Linux hostname 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 00:00:00 UTC 2022 x86_64 GNU/Linux".
The kernel version (5.15.0-56-generic in that example) is not the same as your distribution version. You can have Ubuntu 22.04 running kernel 5.15, or Ubuntu 20.04 running kernel 5.19. Knowing your kernel version matters if you are troubleshooting hardware problems or installing drivers, but for most purposes you want your distribution version instead.
Finding your distribution version on older systems
Older Linux systems may not have lsb_release or /etc/os-release. Try cat /etc/lsb-release first — this file exists on many systems that do not have the lsb_release command installed. If that returns "No such file or directory", look for a distribution-specific file.
Debian systems use cat /etc/debian_version. Red Hat, CentOS, and Fedora systems use cat /etc/redhat-release. Ubuntu systems sometimes use cat /etc/lsb-release-codename to show just the codename (like "jammy" or "focal"). If you do not know which distribution you are running, try all three — one will work and the others will show "No such file or directory".
Reading the output: what each number means
A typical version string looks like "Ubuntu 22.04.1 LTS" or "Fedora 37". The first number (22 or 37) is the major release. The second number after the decimal (04 or none at all) is the minor release. The third number (1 or none) is a patch release — a small update to the major version.
LTS stands for Long Term Support and means Canonical (the company behind Ubuntu) will provide security updates for five years instead of nine months. Non-LTS versions get nine months of updates. This matters if you are running a server or a computer you plan to keep for a long time, because you will eventually stop receiving security patches on a non-LTS version.
Checking if your system is 32-bit or 64-bit
Type uname -m and press Enter. The output will be either "x86_64" (64-bit) or "i686" (32-bit). Most computers made after 2010 run 64-bit, but older machines or specialized systems may still run 32-bit.
This matters because some software only runs on 64-bit systems, and some older software only runs on 32-bit. If you are trying to install a program and it says "architecture not supported", this is usually why. You cannot change your system from 32-bit to 64-bit without reinstalling Linux entirely.
Frequently Asked Questions
What is the difference between kernel version and distribution version?
Your distribution is the package of software that comes with Linux — Ubuntu, Fedora, Debian, etc. Your kernel is the core program that runs underneath. You can upgrade your kernel without changing your distribution, or keep the same kernel while your distribution updates other programs. Most people care about distribution version, but kernel version matters for hardware drivers.
Why does lsb_release not work on my system?
Some minimal or specialized Linux systems do not include the lsb_release tool to save space. Use cat /etc/os-release instead — this file is part of the Linux standard and exists on nearly every system made in the last five years. If that also does not work, your system is very old or very minimal, and you should try the distribution-specific files listed above.
Can I update my Linux version from the terminal?
Yes, but the command depends on your distribution. Ubuntu and Debian use sudo apt update and sudo apt upgrade. Fedora uses sudo dnf upgrade. These commands update the software on your system, but they do not change your major version number — upgrading from Ubuntu 22.04 to 24.04 requires a separate process. Check your distribution's documentation before upgrading.
What if I see different version numbers in different places?
This usually means you are looking at different things — kernel version in one place, distribution version in another, or a package version for a single program. Use lsb_release -a or cat /etc/os-release to see your distribution version, and uname -a to see your kernel version. They are meant to be different.