As Database
Admin, Linux Admin, or system admin, you must have come across this error
or situation,
Here I was
trying to see release details of the Linux operating system using the
lsb_release command but it failed with the below error.
On seeing
this error, I thought lsb_release was not installed on the server, so I tried
to install using the yum command but it failed with the error "Error:
Unable to find a match: lsb_release"
[root@localhost
bin]# lsb_release
bash:
lsb_release: command not found...
[root@localhost
bin]# yum install lsb_release
Last
metadata expiration check: 0:07:24 ago on Sat 30 Dec 2023 11:04:11 AM UTC.
No match
for argument: lsb_release
Error:
Unable to find a match: lsb_release
[root@localhost
bin]#
So here is the trick, you need to identify which
package provides this command using the below method
[root@localhost
bin]# yum whatprovides lsb_release
Last
metadata expiration check: 0:05:10 ago on Sat 30 Dec 2023 11:04:11 AM UTC.
redhat-lsb-core-4.1-47.0.1.el8.i686
: LSB Core module support
Repo
: ol8_appstream
Matched
from:
Filename
: /usr/bin/lsb_release
redhat-lsb-core-4.1-47.0.1.el8.x86_64
: LSB Core module support
Repo
: ol8_appstream
Matched
from:
Filename
: /usr/bin/lsb_release
[root@localhost
bin]#
Here we see package redhat-lsb-core provides the
lsb_release command, so to access lsb_release we need to install the
redhat-lsb-core package, let's try to install it
[root@localhost
bin]# yum install redhat-lsb-core
Last
metadata expiration check: 0:12:20 ago on Sat 30 Dec 2023 11:04:11 AM UTC.
Dependencies
resolved.
==============================================================================================================================================================
Package
Architecture
Version
Repository
Size
==============================================================================================================================================================
Installing:
redhat-lsb-core
x86_64
4.1-47.0.1.el8
ol8_appstream
46 k
Installing
dependencies:
m4
x86_64
1.4.18-7.el8
ol8_baseos_latest
222 k
mailx
x86_64
12.5-29.el8
ol8_baseos_latest
257 k
ncurses-compat-libs
x86_64
6.1-9.20180224.el8
ol8_baseos_latest
328 k
patch
x86_64
2.7.6-11.el8
ol8_baseos_latest
139 k
postfix
x86_64
2:3.5.8-7.el8
ol8_baseos_latest
1.5 M
redhat-lsb-submod-security
x86_64
4.1-47.0.1.el8
ol8_appstream
22 k
spax
x86_64
1.5.3-13.el8
ol8_baseos_latest
217 k
Transaction
Summary
==============================================================================================================================================================
Install
8 Packages
Total
download size: 2.7 M
Installed
size: 7.0 M
Is this ok
[y/N]: y
Downloading
Packages:
(1/8):
mailx-12.5-29.el8.x86_64.rpm
980 kB/s | 257 kB
00:00
(2/8):
m4-1.4.18-7.el8.x86_64.rpm
820 kB/s | 222 kB
00:00
(3/8):
ncurses-compat-libs-6.1-9.20180224.el8.x86_64.rpm
1.1 MB/s | 328
kB 00:00
(4/8):
patch-2.7.6-11.el8.x86_64.rpm
1.3 MB/s | 139 kB
00:00
(5/8):
spax-1.5.3-13.el8.x86_64.rpm
2.1 MB/s | 217 kB
00:00
(6/8):
redhat-lsb-core-4.1-47.0.1.el8.x86_64.rpm
691 kB/s | 46 kB 00:00
(7/8):
redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64.rpm
468 kB/s | 22
kB 00:00
(8/8):
postfix-3.5.8-7.el8.x86_64.rpm
5.6 MB/s | 1.5 MB
00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total
4.9 MB/s | 2.7 MB
00:00
Running
transaction check
Transaction
check succeeded.
Running
transaction test
Transaction
test succeeded.
Running
transaction
Preparing :
1/1
Installing :
redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64
1/8
Installing : spax-1.5.3-13.el8.x86_64
2/8
Running scriptlet: spax-1.5.3-13.el8.x86_64
2/8
Running scriptlet: postfix-2:3.5.8-7.el8.x86_64
3/8
Installing : postfix-2:3.5.8-7.el8.x86_64
3/8
Running scriptlet: postfix-2:3.5.8-7.el8.x86_64
3/8
Installing : patch-2.7.6-11.el8.x86_64
4/8
Installing :
ncurses-compat-libs-6.1-9.20180224.el8.x86_64
5/8
Installing : mailx-12.5-29.el8.x86_64
6/8
Installing : m4-1.4.18-7.el8.x86_64
7/8
Running scriptlet: m4-1.4.18-7.el8.x86_64
7/8
Installing :
redhat-lsb-core-4.1-47.0.1.el8.x86_64
8/8
Running scriptlet: redhat-lsb-core-4.1-47.0.1.el8.x86_64
8/8
Verifying : m4-1.4.18-7.el8.x86_64
1/8
Verifying : mailx-12.5-29.el8.x86_64
2/8
Verifying :
ncurses-compat-libs-6.1-9.20180224.el8.x86_64
3/8
Verifying : patch-2.7.6-11.el8.x86_64
4/8
Verifying : postfix-2:3.5.8-7.el8.x86_64
5/8
Verifying : spax-1.5.3-13.el8.x86_64
6/8
Verifying :
redhat-lsb-core-4.1-47.0.1.el8.x86_64
7/8
Verifying :
redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64
8/8
Installed:
m4-1.4.18-7.el8.x86_64
mailx-12.5-29.el8.x86_64
ncurses-compat-libs-6.1-9.20180224.el8.x86_64
patch-2.7.6-11.el8.x86_64
postfix-2:3.5.8-7.el8.x86_64
redhat-lsb-core-4.1-47.0.1.el8.x86_64
redhat-lsb-submod-security-4.1-47.0.1.el8.x86_64
spax-1.5.3-13.el8.x86_64
Complete!
[root@localhost
bin]#
After installation, I was able to access it
[root@localhost bin]# lsb_release
LSB Version: :core-4.1-amd64:core-4.1-noarch
[root@localhost bin]#