asebomybest.blogg.se

Find redhat linux version
Find redhat linux version






So you're doing this the right way, or at least the same way facter does. ~]# facter ~]# facter ~]# touch ~]# facter operatingsystem In short, Oracle Enterprise Linux detection totally hinges on the presence of /etc/enterprise-release. "PSBM" => "^Parallels Server Bare Metal", Operatingsystem = get_redhat_operatingsystem_name Snip if FileTest.exists?("/etc/enterprise-release")Įlsif FileTest.exists?("/etc/redhat-release") Take a look at the OS-detection routine that facter uses. I'd be using the osfamily and maybe the operatingsystemmajrelease fact. But I think you probably only care that they're RedHat derivatives. They're CentOS and RHEL, versions 5.8, 5.9 and 6.5. # facter operatingsystem operatingsystemmajrelease operatingsystemrelease osfamilyĪnd # facter operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily Look at the facter output from the following three systems. I don't think that's your issue here, though, as you probably only care about the OS "family".

#Find redhat linux version software

So software should be able to run on *EL5.4, 5.8 and 5.10, for example. When dealing with RHEL and its derivatives, it's important to know that the distribution lifecycle strives to maintain compatibility between minor releases. If it is your company/environment, facter is the cleanest method. If this is software that will be shipped and run on systems that you don't manage, then you'll likely have to have to handle OS-detection. ( Are Mandrake, AsianUX and UnitedLinux still around enough to certify compatibility on new software?)ĭefinitely check the suggestions at: What version of RHEL am I using?īut beyond that, look at facter if you have some control over the systems this software will be deployed on. This does not seem to be a viable solution hence seeking other more definite methods for determining the version of the OS. In case the ordering was otherwise with redhat appearing before enterprise /etc/redhat-release would be used. The /etc/*-release file is examined as a part of a programmatic solution, the value of * is provided by a dummy file which can have these values :Īsianux,enterprise,mandrake,redhat,UnitedLinux,Suse,SuSEĭepending on the order of appearance in the above scenario since enterprise appears first /etc/enterprise-release file is queried to find the OS version Valid values : lsb_release -a returns the same output as returned by enterprise-release Using alternatives as mentioned below are used only in case the above files don't return Red Hat Enterprise Linux Server release 5.8 (Tikanga)Įnterprise Linux Enterprise Linux Server release 5.8 (Carthage) But on the OEL system, the following files are present and all of them seem to be returning valid release versions, in such situations is there a definite method of determining the OS release version details : cat /etc/redhat-release Tested on rhel 6.7, rhel 7.2, debian 8.3 and ubuntu 14. *here would be the family to which the particular version of the OS belongs to. If you want to just get the version numbers the following is about as short and simple as I can get it. The usual methods to determine the OS versions seem to be viewing /etc/*-release file






Find redhat linux version