Why do we care about the lsb_release command? I was sitting there on my Ubuntu system trying to remember if I had already upgraded it or not and version of Ubuntu I had. It was harder than I expected to find the version of Ubuntu I am running until i found lsb_release. Here is the command i used:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
And a screenshot of the same:
lsb_release -sc is a handy and popular command line option. It will show you the Codename only in brief. ‘s’ is for short output format and ‘c’ is for codename. See the code and screenshot below:
bionic
lsb_release -d is good for a verbose description of the release version you have based on the number. See below:
Description: Ubuntu 18.04 LTS
No LSB modules are available.
If you get the above error message from lsb_release -v or lsb_release with no arguments you are missing the lsb_core package.
Go ahead and install lsb-core as such:
Now try the lsb_release command with no arguments and see the error message “No LSB modules are available is replaced with real output:
Parsing and understanding the information provided in the output of lsb_release -v (the Linux Standard Base version) is not easy, but the purpose of it is to provide compatibility between Linux versions off of the same base components even with different Linux distributions. That seems like an admirable goal, however the experience of this author, is that rarely is software compatible between different Linux distributions and packages are usually available for each major distribution so its not really necessary to be compatible.
That being said, the lsb_release tool itself is quick and available from the command line and helped me to find the info I was looking for which is basic information about the version of the Linux distribution currently being run.