問題描述
我如何在 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 Mordadi、Hakimeh Mordadi)