How To Determine CentOS or Red Hat Version
Posted by Jeffrey Huckaby 03/10/2009
Versions. Versions. Versions. Understanding versions for Linux systems is not as easy as one may expect. When you manage Linux servers daily, you get used to the nomenclature, but unless you live and breath Linux, the versions can be tedious to deal with.
The numerous Linux distributions combined with differing practices by control panel vendors produces dizzying array of versions, releases, hot fixes, errata, bug fixes, patches, updates, and workarounds. Further complicating matters, many vendors do not update version numbers when they patch something – they simply tack on a letter or another decimal place. Red Hat, for example, often “back ports” security fixes into prior releases. While this practice is required to keep older versions secure, back ports make it difficult to decipher what has and has not been fixed with any particular software package. Control panel vendors use varying naming and numbering schemes for their updates, making it difficult for the busy business owner to know if their servers are updated or not. To help untangle this mess, I want to provide you with a few tips on how to find the version (distributions) of your Linux OS.
Distributions vs. Versions
Linux has many flavors. Fedora and Red Hat “distributions” are popular in the US while SUSE is a favorite in Europe. Other distributions like Mandrake, Trustix and YellowDog target specific user and market segments. CentOS is a rapidly growing new comer to the field. CentOS is a version of Linux derived from Red Hat Enterprise Linux (RHEL). Many control panel vendors now support CentOS in addition to RHEL and Fedora.
RHEL, Fedora and CentOS are among the most frequently encountered when dealing with dedicated hosting providers, so we will focus on those throughout this tutorial.
Most Red Hat-based distributions should have a file called redhat-release. You can find it in:
You just need to view this file using:
This should return the version you are using. Note that this file can be manually changed or updated but provided that someone has not modified this file, the information should be accurate. On a RHEL 3 system you will see something like:
Red Hat Enterprise Linux ES release 3 (Taroon Update 6)
For now you can ignore the bit in the parenthesis. This tells you that your distribution is Red Hat Enterprise Linux ES Release 3, more frequently referred to as RHEL 3. The ES stands for Enterprise Server, which is what you will likely encounter if you lease a system from a dedicated server provider. Red Hat provides three versions of the enterprise edition called workstation (WS), enterprise server (ES) and advanced server (AS) releases. You can read more about the differences between these over at Red Hat.
If you happen to be using Fedora you will see something similar to:
Fedora Core release 1 (Yarrow)
This indicates you are using the Fedora distribution. Core 1 is the version and Yarrow is a release nickname. You will typically encounter this referred to as FC1.
Another example, is CentOS:
CentOS release 4.2 (Final)
This says you are using CentOS, the free version derived from RHEL.
Using the /etc/redhat-release file, you can determine your distribution type and often your version.
Linux distributions often have “versions”. Versions are things like Red Hat 7.3, RHEL 3, or RHEL 4. These represent major releases. When someone asks what version of Red Hat you are using, you would likely reply with RHEL 3 or RHEL 4. Fedora has “Core” releases. Core releases are major version differences. An upgrade from Fedora Core 1 to Fedora Core 2 is non trivial. Major components of Linux, including the kernel itself, undergo major upgrades. So, to keep terms straight, if you see:
Fedora Core release 1 (Yarrow)
As the output from /etc/redhat-release, you are running the Fedora Core distribution and the version is Core 1.
RHEL and CentOS have updates between major releases. Fedora’s development cycle is so fast that several new versions are released per year. This rapid update pace is why we recommend CentOS or RHEL for production servers, where maintenance, reliability and continuity are more important than bleeding edge features.
If you look at the redhat-release file, you will see something like “Update 6”. This means you are running Update 6 for RHEL 3. Updates are major package releases from Red Hat. You should always use the latest update for your RHEL version.
There is a bit of good news with CentOS. They use a simple decimal increment system. So CentOS 4.1 is an update to 4.0. CentOS 3.6 is and update from 3.5, which is an update from 3.4 and so on. A simple approach, I wish other vendors would use.
For security reasons, you should be running the latest update or version of your Linux distribution. You can check the Red Hat or CentOS web sites for the latest version information. Fortunately, we keep track of versions for you in our version watch section of our blog.
Lastly, I want to touch on errata. Errata are simply bug fixes and security updates released by Red Hat, Fedora and CentOS. Errata are frequent for Linux and unlike Microsoft’s Patch Tuesday, there is no set schedule for errata. It is not uncommon to see several errata appear in one day. The urgency of the bug fix depends on the impact it may have on your server’s operation or security. Some security issues demand immediate attention and errata should be applied as soon as possible. Other issues may be minor and can wait until your next scheduled maintenance period.
Keeping your system fully patched with errata is essential for security. Unfortunately, some errata may interfere with control panels like cPanel, Ensim, or Plesk. So you may need to check with your control panel vendor before rushing to apply the latest bug fix. Lastly, not all errata apply to your server. For example, when we secure systems we remove 100’s of unnecessary software items; this reduces your exposure to potential security problems. In fact, many of the errata that are released daily deal with desktop, GUI, and similar type software often not found on properly secured servers.
A major source of confusion with RHEL, CentOS and Fedora are software version numbers. Red Hat often back-ports security and bug fixes into older versions of the software. For example, RHEL 3 Update 6 uses PHP version 4.3.2. But if you visit the PHP web site, you will see PHP 4.4.1 and PHP 5.1.1. So is your PHP version up to date? Well it depends on what you mean. Red Hat will back port important security and bug fixes from 4.4.1 to 4.3.2. This approach assures that your PHP version changes as little as possible while incorporating important security fixes. Red Hat uses release numbers to differentiate minor version changes they make to PHP 4.3.2. Right now they are on PHP 4.3.2 Release 26.ent. This version has all major security patches that 4.4.1 has but at the core it is still 4.3.2. So if you have all of the errata for your RHEL version installed, you will be using the latest Red Hat version of PHP but not the latest PHP release. To use the latest PHP release, you would have to manually compile PHP or find a third party that has built RPMs for your distribution.
Similar version issues arise with MySQL, Apache, Sendmail, and other major programs. If you are using a control panel, the ability to use a third party solution or manually use the latest Apache or PHP release may be limited. It is best to check with a system administrator familiar with your control panel before updating to a version not released by Red Hat.
Using your redhat-release file, you can determine your distribution, version and update number. This information is very helpful for technical support staff as well as knowing if you are up to date with the latest patches. Having this info can help you quickly determine if software will be compatible with your system. Keeping on top of errata can keep your system secured and running smoothly.
Add CommentCommenting is not available in this section entry.
Recent Blog Posts
Jeffrey Huckaby Honored in Fifth-Annual MSPmentor 250
Posted by rackAID 01/03/2013
Improve CRO, SEO and Usability with these Simple Tools
Posted by Jeffrey Huckaby 10/31/2012
12 Point Server Maintenance Checklist
Posted by Jeffrey Huckaby 10/29/2012