Linux lsb_release command

Updated: 05/05/2017 by Computer Hope

About lsb_release

The lsb_release command displays LSB (Linux Standard Base) information about your specific Linux distribution. It's a reliable way to get version information about the Linux system you're using.

lsb_release syntax

lsb_release [OPTIONS]

lsb_release options

Like all GNU software, lsb_release uses a single dash (-) for short options, and two dashes (--) for long options.

-v, --version Show the version of the Linux Standard Base that your system is compliant with. The version is displayed as a colon-separated list of LSB module descriptions.
-i, --id Display the ID of your Linux distributor. For instance, if you are running Debian, this option will display
Distributor ID: Debian
-d, --description Display a description of your Linux distribution. For instance, if you are running CentOS 7, this will display something like
Description: CentOS Linux release 7.3.1611 (Core)
-r, --release Display the release number of the current operating system. For instance, if you are running Fedora 25, this will output
Release: 25
-c, --codename Display the codename of the current operating system. For instance, if you are running Ubuntu 16.04, this will display
Codename: xenial
-a, --all Display all of the above information. For instance, if you are running Arch Linux, this will display
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
-s, --short Use the "short" output format, which omits headers. You can use this in combination with another option. For instance, if you are running Fedora 25, the command

lsb_release -rs

will display:
25
-h, --help Display a help message which summarizes these options.

Installing LSB Core

lsb_release is part of a software package called the LSB core, which is not necessarily installed on your system by default.

To install it, run the command below that corresponds to your specific system:

Ubuntu, Debian

sudo apt-get update && sudo apt-get install lsb-core

CentOS

sudo yum update && sudo yum install redhat-lsb-core

Fedora

sudo dnf update && sudo dnf install redhat-lsb-core

OpenSUSE

sudo zypper update && sudo zypper install lsb-core

Arch

pacman -Syu lsb-release

Other distributions

If your Linux distribution is not listed here, consult your package manager's repository for the package that contains "lsb-core" and/or "lsb_release".

lsb_release examples

lsb_release -a

Display all LSB information specific to your Linux distribution. Output will resemble the following:

LSB Version:    core-5.0-amd64:core-5.0-noarch
Distributor ID: openSUSE project
Description: openSUSE Leap 42.2
Release: 42.2
Codename: n/a

Note: If you receive a message like this:

No LSB modules are available

...you will need to install the LSB core software first. See section Installing LSB Core above for more information.

uname — Print information about the current system and its kernel.