我如何在亚马逊 Linux AMI 上找到我的 Linux 发行版?

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

Amazon Web Services (AWS) 提供官方支持的 Amazon Machine Image AMI,但未指明它基于哪个 Linux 发行版。

并且我们在安装软件时需要Linux发行版本,如:vagrant等....

我使用:**hostnamectl** 命令,结果如下所示:


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

正如我们所见,没有任何关于 Linux 发行版版本的信息。

我也使用这个命令:pm –qa centos-release 结果如下所示:


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]

但是,我仍然看不到有关 Linux 发行版版本的任何信息。

我写在下面的答案里

你知道这个提议的任何其他命令吗?

终于找到魔法命令了**cat /proc/version**

结果是:


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