I am using the default Amazon Linux AMI in an EC2 instance - Amazon Linux AMI release 2010.11.1. I can see that it's a Redhat based system, but after trying many tools (/etc/issues, uname -a, lsb_release), I cannot tell which version of RHEL or CentOS is it based on. I need to get some packages that are not available in Amazon's package repos. I have list of custom yum repos that I can use, but since I don't know which RHEL version is the Amazon AMI based on, I cannot choose from different versions of repos.

How can I find whether it's running RHEL 4/5/6 (or their CentOS counterparts)?

3 Answers 3


It looks like the answer is not straight-forward. Here's a response from Amazon rep on AWS forum:

The Amazon Linux AMI is based on RHEL 5.x and parts of RHEL6. One of our goals is binary compatibility with RHEL 5.x, and therefore CentOS5.x. Astute users will note that our kernel is based on 2.6.34, and we have engineered the image to conform to a cloud environment. For example, the lack of Xorg support helps to keep the images small and lean. The goal of the Amazon Linux AMI is to provide an image for use in the cloud and to serve as reference image of EC2 best practices. The maintenance (security, enhancements, features and bug fixes) for the image will come directly from Amazon, while maintaining maximum compatibility, security and functionality.


You can tell what RedHat based release you are running by looking at the content of /etc/redhat-release.

It is possible that this file may have been removed but it that is the case some tools will not accept they are running on a RedHat'ish system.

EDIT: Try running one (or more) of the following commands

rpm -qa | grep el
rpm -qa | grep centos
rpm -qa | grep rhel

These will show if any RHEL 5/6 or CentOS 5 packages are installed.

If you see some el5 and some centos you are running CentOS5. If you see only el5 you are running RHEL 5 (CentOS 5 and RHEL 5 packages are interchangable anyway).

If you see el4 it's RHEL 4 or possibly CentOS 4 - I'd think this unlikely.

If you see rhel6 or el6 it's RHEL 6.

You could also try

rpm -qa | grep release

Which may also give the game away.

  • Yes, /etc/redhat-release is not there. After I installed lsb, there is /etc/redhat-lsb directory though.
    – Jayesh
    Jun 27, 2011 at 15:03

Amazon's user guide (at the bottom of the page) mentions that it's mostly compatible with CentOS5 or later.

You should be able to compare your kernel version to the CentOS releases to pick the closest match. Based on the kernel version listed in their release notes, they may be tracking Fedora a bit more closely than Enterprise. RHEL6 is still at 2.6.32.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .