我如何在 amazon Linux AMI 上找到我的 Linux 發行版? (How i could find my Linux distribution on amazon Linux AMI?)


問題描述

我如何在 amazon 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,結果如下所示:

p>

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發行版版本的任何信息。

我將其寫在下面的答案中。

你知道這個提議的其他命令嗎?


參考解法

方法 1:

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

(by Hakimeh MordadiHakimeh Mordadi)

參考文件

  1. How i could find my Linux distribution on amazon Linux AMI? (CC BY‑SA 2.5/3.0/4.0)

#linux-kernel #amazon-web-services #linux #redhat #server






相關問題

選擇 Linux I/O 調度程序 (Selecting a Linux I/O Scheduler)

Android可加載內核模塊錯誤:賦值使指針從沒有強制轉換的整數 (Android Loadable Kernel Module Error: assignment makes integer from pointer without a cast)

文件描述符中實際存儲了多少信息? (How much information is actually stored in a file descriptor?)

hrtimer mengulangi tugas di kernel Linux (hrtimer repeating task in the Linux kernel)

我可以在 C 代碼中使用 LKM 內核代碼中的“getpwuid”嗎? (Can I use "getpwuid" from kernel code in LKM in c code?)

將傳入數據包注入網絡接口 (Injecting an incoming packet to a network interface)

無法從 D3 睡眠狀態喚醒 pci 總線 (Unable to wake pci bus form D3 sleep satate)

在 Linux 中使用 DMA 的最簡單方法 (Easiest way to use DMA in Linux)

Linux I2C 通信問題 (Linux I2C communication issues)

理解 perf stat 輸出中的數字 (Make sense of numbers in perf stat output)

我如何在 amazon Linux AMI 上找到我的 Linux 發行版? (How i could find my Linux distribution on amazon Linux AMI?)

將參數傳遞給系統調用 (Passing arguments to system calls)







留言討論