Created
December 5, 2017 21:29
-
-
Save gavin-romig-koch/5b4ee307a4d038c66d89a6ca2aa08d92 to your computer and use it in GitHub Desktop.
What version of RHEL?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you know you are on RHEL or Centos what are the ways to determine | |
which version you are on? | |
Well it depends upon why you want to know. Most reciently i wanted to automatically | |
choose the correct version of EPEL to install. I chose to use | |
yum version | grep '^Installed: ' | sed -e 's!^Installed:[ \t]\+\([^ \t/]\).*$!\1!' | |
other possibilities, instead of yum were: | |
rpm -q --queryformat '%{VERSION}' -f /etc/redhat-release | |
rpm -q --queryformat '%{VERSION}' --whatprovides redhat-release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment