rpm - Amazon Linux AMI release 2010.11.1 corresponds to which RHEL version (4/5/6)?

09
2013-08
  • Jayesh

    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)?

  • Answers
  • Jayesh

    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.

  • Haqa

    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.

  • Joe Internet

    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.


  • Related Question

    How to know which Linux Distribution I'm using?
  • Mithun

    How to know which Linux Distribution I'm using?

    uname -a gives

    Linux xxxxxx.net 2.6.9-42.0.3.EL.wh1smp #1 SMP Fri Aug 14 15:48:17 MDT 2009 i686 i686 i386 GNU/Linux

    How can I know this is Ubuntu/Debian/Fedora or Redhat?

    I uses /etc/init.d/serviced restart for restarting serevices, seems it is not Redhat family

    [itf][~]$ cat /etc/issue
    cat: /etc/issue: No such file or directory
    [itf][~]$ cat /etc/issue.net
    cat: /etc/issue.net: No such file or directory
    [itf][~]$ lsb_release -a
    -sh: lsb_release: command not found
    [itf][~]$ cat /etc/*-release
    cat: /etc/*-release: No such file or directory
    [itf][~]$ cat /etc/*-version
    cat: /etc/*-version: No such file or directory
    [itf][~]$ cat /etc/*release
    cat: /etc/*release: No such file or directory
    [itf][~]$ cat /etc/*_release
    cat: /etc/*_release: No such file or directory
    [itf][~]$ cat /etc/*version
    cat: /etc/*version: No such file or directory
    [itf][~]$
    

  • Related Answers
  • Marcin Gil

    You might try this article from Novell.

    If you are the owner of the system, then you know which Linux is installed and running. This article will help you to understand how to determine which Linux distribution is installed. You can incorporate this into your application to detect Linux distro.

  • Tom Wijsman
    • In Debian: /etc/debian_version

    • In Ubuntu: lsb_release -a or /etc/debian_version

    • In Redhat: cat /etc/redhat-release

    • In Fedora: cat /etc/fedora-release

  • Journeyman Geek

    Hmm, maybe its another distro - the .EL suffix seems to be used by centos, but that's a redhat dervative. I'm also wondering what's your package management system? It might help to check whose repos you use- since these are usually vendor supplied, and distro specific

  • Ignacio Vazquez-Abrams

    Based on the kernel version I'd say it's WBEL 4. They've been known to lag a bit with their updates, so it would probably be best to migrate to CentOS at your convenience.

  • Tom Wijsman

    Try http://legroom.net/2010/05/05/generic-method-determine-linux-or-unix-distribution-name.

    A combination of techniques that combines querying the LSB utilities, distro release info files, and kernel info from uname. It'll take the most specific distro name it can find, falling back to generic Linux if necessary. It'll also identify UNIX variants as well, such as Solaris or AIX.

  • slhck

    Try one of these:

    ls -ld /etc/\*release\*  /etc/\*version\*
    
    gcc --version