lsb_release
is an important command for bash scriptwriters. It lets the user know about the currently installed Linux distribution, the specific version, and the codename.
Yesterday I was trying to set up a Raspberry pi web server for my client and found out the script I was running to set up certain packages needed to know the distribution name. The script was using lsb_release
command to know the distribution’s name but failed with the error “lsb_release command not found”.
I thought the lsb_release command is available in all Linux distributions out of the box, but it is not.
If you get the error “lsb_release command not found“, here is how you can fix it.
Fix for lsb_release command not found
To fix the error, we need to install the lsb-core package. This package is available in almost all repositories. So install lsb-core and it will fix the error.
If your distribution is not Debian-based, it should still be available in the repositories. Use the distro package manager to install lsb-core.
sudo apt install lsb-core
For fedora or derivates –
sudo dnf install lsb-core
For CentOS or derivatives –
sudo yum install lsb-core
For Arch or derivatives –
sudo pacman -S lsb-core
![[Fixed] How To Fix &Amp;Quot;Lsb_Release Command Not Found&Amp;Quot; Error In Linux 1 install lsb core](https://i0.wp.com/www.linuxandubuntu.com/wp-content/uploads/2020/08/install-lsb-core.png?resize=945%2C506&ssl=1)
Here is how to use lsb_release
command.
lsb_release returns the currently running lsb version. BTW, lsb stands for Linux Standard Base.
![[Fixed] How To Fix &Amp;Quot;Lsb_Release Command Not Found&Amp;Quot; Error In Linux 2 lsb_release](https://i0.wp.com/www.linuxandubuntu.com/wp-content/uploads/2020/08/lsb_release.png?resize=945%2C302&ssl=1)
lsb_release -a
![[Fixed] How To Fix &Amp;Quot;Lsb_Release Command Not Found&Amp;Quot; Error In Linux 3 lsb release a](https://i0.wp.com/www.linuxandubuntu.com/wp-content/uploads/2020/08/lsb_release-a.png?resize=945%2C354&ssl=1)
lsb_release -c
![[Fixed] How To Fix &Amp;Quot;Lsb_Release Command Not Found&Amp;Quot; Error In Linux 4 lsb release c](https://i0.wp.com/www.linuxandubuntu.com/wp-content/uploads/2020/08/lsb_release-c.png?resize=945%2C292&ssl=1)
lsb_release -r
![[Fixed] How To Fix &Amp;Quot;Lsb_Release Command Not Found&Amp;Quot; Error In Linux 5 lsb release r](https://i0.wp.com/www.linuxandubuntu.com/wp-content/uploads/2020/08/lsb_release-r.png?resize=945%2C292&ssl=1)
You can also combine the arguments to get just the information you need.
lsb_release -rcd
![[Fixed] How To Fix &Amp;Quot;Lsb_Release Command Not Found&Amp;Quot; Error In Linux 6 lsb release rcd](https://i0.wp.com/www.linuxandubuntu.com/wp-content/uploads/2020/08/lsb_release-rcd.png?resize=945%2C344&ssl=1)