Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine Redhat Linux Version

How do I determine which RedHat Linux version I am running?

Here's what I've read:

  • /etc/redhat-release file contains the version, but anybody can tamper with that file.
  • people say uname command, but you can install any kernel on Redhat.

If I am running redhat 5.1 and someone upgrade it with 5.2 or 5.x, what determines the version of RedHat?

even lsb_release -a read /etc/redhat-release file.

like image 502
Satish Avatar asked Mar 01 '13 18:03

Satish


2 Answers

Try this command:

rpm -qa | grep release

for instance on my machine I get this

redhat-release-workstation-6Workstation-6.4.0.4.el6.x86_64

like image 168
Tim Avatar answered Sep 22 '22 18:09

Tim


If "anybody" has root access to your machine to either change /etc/redhat-release or install an alternate kernel you're most probably in bigger trouble than determining the redhat version of your system.

Just use the value pointed out by /etc/redhat-release or even better in terms of portability use the output of lsb_release as this is exactly the purpose they were made for.

With "anybody" being able to do anything with your system there is no other chance at all.

like image 38
mikyra Avatar answered Sep 25 '22 18:09

mikyra