19 September 2012

Check CentOS Version

Ever go to install a package, but can’t remember which specific version of CentOS you’re running? This often happens to me, and helpfully I can never remember the command. So for as much my benefit as yours, this is what you do:

Run:


cat /etc/redhat-release

which will return your version number, eg:


CentOS release 5.8 (Final)

Edit:

The command:


cat /etc/centos-release

works in CentOS 6.