lsb_release Command on Ubuntu

28/12/2020
The lsb_release command is a helpful utility to find out information about your Linux installation. I will test drive it in this article on my new Ubuntu 18.04 LTS release install.

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:

:~$ lsb_release -a
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 -a on Ubuntu 18.04

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:

:~$ lsb_release -sc
bionic

lsb_release -sc on Ubuntu 18.04

lsb_release -d is good for a verbose description of the release version you have based on the number. See below:

:~$ lsb_release -d
Description:    Ubuntu 18.04 LTS

lsb_release -d on Ubuntu 18.04

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.

Error message when missing lsb-core package

Go ahead and install lsb-core as such:

:~$ sudo apt-get install lsb-core

Now try the lsb_release command with no arguments and see the error message “No LSB modules are available is replaced with real output:

lsb_release after installing lsb-core

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.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Install Anaconda Python on Ubuntu

Anaconda is a distribution of the Python programming language, which is used by data scientists all over the world. Anaconda...
12/02/2020

How to Listen to WAV Files on Ubuntu

There are a number of available media file types all over the internet, each of them having their own features and disadvantages....
29/12/2020

Audacious 3.8.2 – Advanced Audio Player released with Vulnerability fixn Ubuntu 16.10

Audacious is an advanced, feature rich music player for GNOME using GTK 3 interface. While its one of the best lightweight...
12/02/2020
Bài Viết

Bài Viết Mới Cập Nhật

Dịch Vụ Xây Dựng Hệ Thống Peering Với Internet Exchange (IXP)
04/04/2025

Dịch Vụ Triển Khai VPN Site-to-Site & Remote Access
04/04/2025

Dịch Vụ Thiết Lập Hệ Thống Tường Lửa (Firewall)
04/04/2025

Dịch Vụ Triển Khai Hệ Thống Ảo Hóa & Cloud
04/04/2025

Dịch Vụ Triển Khai Hệ Thống Ceph
04/04/2025