There are several ways of checking the version of a Linux system. Among them is the use of the lsb_release -a
command which prints out the Linux distribution, the description, release, and codename of the Linux system you are running. However, sometimes you can run into the error ‘lsb_release command not found‘ as shown in the screenshot below.
$ lsb_release -a
Causes of the lsb_release command not found error
The error is caused by a missing package that provides the command and which is not installed by default. To find out which software package provides the command, run the command:
$ sudo dnf whatprovides lsb_release
Sample output
Last metadata expiration check: 24 days, 20:55:23 ago on Sun 06 June 2021 12:37:52 PM UTC. redhat-lsb-core-4.1-47.el8.x86_64 : LSB Core module support Repo : rhel-8-appstream-rhui-rpms Matched from: Filename : /usr/bin/lsb_release redhat-lsb-core-4.1-47.el8.i686 : LSB Core module support Repo : rhel-8-appstream-rhui-rpms Matched from: Filename : /usr/bin/lsb_release
From the output, we can see that the package that provides the command is redhat-lsb-core.
Solution
To fix the problem, we will install the redhat-lsb-core package as follows.
$ sudo dnf install redhat-lsb-core
This installs the core package alongside other dependencies. When prompted to proceed, Type ‘Y’ and hit ENTER to proceed with the installation.
The output below confirms that the package plus all of its dependencies have been installed.
Once the installation is done, now try to run the command again, and this time you should get the expected output.
$ lsb_release -a
The solution is as simple as that. We hope that you have found this brief guide beneficial in fixing the error. Keep it Cloudcone for more tutorials like these.