Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

26
  • 2
    I would check for lsb_release and use it if available, but it isn't available everywhere. For instance, it isn't in the default install of Fedora 14. Commented Jan 24, 2011 at 5:47
  • 1
    rpm -qa "lsb* prints nothing. According to yum provides */lsb_release it is contained in a package called redhat-lsb which I guess is not installed by default. However, I'm not a Fedora expert, these are just the results from a random Fedora VM I have and could be very wrong. Commented Jan 24, 2011 at 6:01
  • 3
    Just installed Fedora 14 in a VM, and there is no lsb-release, as you said. Commented Jan 24, 2011 at 6:07
  • 1
    @Mikel: lsb_release seems to work great on Ubuntu 10.04 LTS, however in Fedora and CentOS I get a "command not found" error message. Also, /etc/lsb-release doesn't seem to exists in RHEL distros. On Fedora 13 for instance I have fedora-release, redhat-release and system-release. Commented Jan 24, 2011 at 6:24
  • 8
    Don't use $OS, $VERSION, etc -- by convention, we capitalize environment variables (PAGER, EDITOR, SHELL, ...) and internal shell variables (BASH_VERSION, RANDOM, ...). All other variable names should contain at least one lowercase letter. This convention avoids accidentally overriding environmental and internal variables. Commented Sep 16, 2011 at 20:18