Search This Blog

2013-05-08

lsb_release

What is lsb_release and How To Install


lsb_release is useful for finding out which information about the distribution of Linux you currently have installed.

It provides the description of the Linux distribution, codename, release

Example usage:
lsb_release -a
LSB Version:      :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID:   RedHatEnterpriseServer
Description:      Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Release:          5.6
Codename:         Tikanga

Occasionally some distributions will not install lsb_release by default and give a similar message to
sh: /usr/bin/lsb_release: No such file or directory

This can easily be resolved by installing packages that includes lsb_release
  1. Look for which packages you need to install to get lsb_release
  2. yum whatprovides */lsb_release
    Loaded plugins: product-id, rhnplugin, security, subscription-manager
    Updating certificate-based repositories.
    Unable to read consumer identity
    This system is not registered with RHN.
    RHN Satellite or RHN Classic support will be disabled.
    redhat-lsb-4.0-3.el6.i686 : LSB base libraries support for Red Hat Enterprise Linux
    Repo        : rhel-disc
    Matched from:
    Filename    : /usr/bin/lsb_release
    
    
    
    redhat-lsb-4.0-3.el6.x86_64 : LSB base libraries support for Red Hat Enterprise Linux
    Repo        : rhel-disc
    Matched from:
    Filename    : /usr/bin/lsb_release
    
    
    
    redhat-lsb-4.0-3.el6.x86_64 : LSB base libraries support for Red Hat Enterprise Linux
    Repo        : installed
    Matched from:
    Filename    : /usr/bin/lsb_release
    
  3. Install the package that gives you lsb_release
  4. yum install redhat-lsb

lsb_release Alternatives

If you do not need lsb_release but still want to know what verison of Linux you're running. There is usually a file located in /etc/*-release which you can display the contents of to figure out the version
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)

References:
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014217599
http://nixcraft.com/centos-rhel-fedora/16967-redhat-console-show-version.html
http://forums.fedoraforum.org/showthread.php?t=220885

No comments:

Post a Comment