Search code examples
linuxamazon-web-servicesserverlinux-kernelredhat

How i could find my Linux distribution on amazon Linux AMI?


Amazon Web Services (AWS) offers an officially supported Amazon Machine Image AMI, but it doesn't indicate which Linux distribution it's based upon.

And we need the version of Linux distribution when installation software like : vagrant and so one ....

I use : **hostnamectl** command with result shown in the below :


Static hostname: a-1fxzvx1ww7twk
   Pretty hostname: A-1FXZVX1WW7TWK
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 10c579b792b74c5bbababbcbd78df49e
           Boot ID: e444cb9e35354d53a45c28fe7384bc7f
    Virtualization: kvm
  ***Operating System: Amazon Linux 2***
       CPE OS Name: cpe:2.3:o:amazon:amazon_linux:2
            Kernel: Linux 4.14.181-142.260.amzn2.x86_64
      Architecture: x86-64

As we see there isn't any information about the version of Linux distribution.

Also i use this command : pm –qa centos-release with the result of shown in the below :


Usage: rpm [-aKfgpqVcdLilsiv?] [-a|--all] [-f|--file] [-g|--group]
        [-p|--package] [--pkgid] [--hdrid] [--triggeredby] [--whatrequires]
        [--whatprovides] [--nomanifest] [-c|--configfiles] [-d|--docfiles]
        [-L|--licensefiles] [--dump] [-l|--list] [--queryformat=QUERYFORMAT]
        [-s|--state] [--nofiledigest] [--nofiles] [--nodeps] [--noscript]
        [--allfiles] [--allmatches] [--badreloc] [-e|--erase <package>+]
        [--excludedocs] [--excludepath=<path>] [--force]
        [-F|--freshen <packagefile>+] [-h|--hash] [--ignorearch] [--ignoreos]
        [--ignoresize] [-i|--install] [--justdb] [--nodeps] [--nofiledigest]
        [--nocontexts] [--nocaps] [--noorder] [--noscripts] [--notriggers]
        [--nocollections] [--oldpackage] [--percent] [--prefix=<dir>]
        [--relocate=<old>=<new>] [--replacefiles] [--replacepkgs] [--test]
        [-U|--upgrade <packagefile>+] [--reinstall=<packagefile>+]
        [-D|--define 'MACRO EXPR'] [--undefine=MACRO] [-E|--eval 'EXPR']
        [--macros=<FILE:...>] [--noplugins] [--nodigest] [--nosignature]
        [--rcfile=<FILE:...>] [-r|--root ROOT] [--dbpath=DIRECTORY]
        [--querytags] [--showrc] [--quiet] [-v|--verbose] [--version]
        [-?|--help] [--usage] [--scripts] [--setperms] [--setugids]
        [--setcaps] [--restore] [--conflicts] [--obsoletes] [--provides]
        [--requires] [--info] [--changelog] [--xml] [--triggers] [--last]
        [--dupes] [--filesbypkg] [--fileclass] [--filecolor] [--fscontext]
        [--fileprovide] [--filerequire] [--filecaps]

But, still i couldn't see any information about the version of Linux distribution.

I write it in the answer below.

Do you know any other commands for this propose ?


Solution

  • Finally, i can find the magic command **cat /proc/version**

    The result is:

    
    Linux version 4.14.181-142.260.amzn2.x86_64 (mockbuild@ip-10-0-1-132) (gcc version 7.3.1 20180712 (**Red Hat 7.3.1-8**) (GCC)) #1 SMP Wed Jun 24 19:07:39 UTC 2020