選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

Identify AL2 instances

焦點模式
Identify AL2 instances - Amazon Linux 2
此頁面尚未翻譯為您的語言。 請求翻譯

The following information describes how to identify an AL2 instance from another Amazon Linux version or other Linux distribution.

Identify Amazon Linux images

Each image contains a unique /etc/image-id file that identifies it. This file contains the following information about the image:

  • image_name, image_version, image_arch – Values from the build recipe that Amazon used to construct the image.

  • image_stamp – A unique, random hex value generated during image creation.

  • image_date – The UTC time of image creation, in YYYYMMDDhhmmss format.

  • recipe_name, recipe_id – The name and ID of the build recipe Amazon used to construct the image.

Amazon Linux contains an /etc/system-release file that specifies the current release that is installed. This file is updated using yum and is part of the system-release RPM Package Manager (RPM).

Amazon Linux also contains a machine-readable version of /etc/system-release that follows the Common Platform Enumeration (CPE) specification; see /etc/system-release-cpe.

AL2

The following is an example of /etc/image-id for the current version of AL2.

[ec2-user ~]$ cat /etc/image-id image_name="amzn2-ami-hvm" image_version="2" image_arch="x86_64" image_file="amzn2-ami-hvm-2.0.20180810-x86_64.xfs.gpt" image_stamp="8008-2abd" image_date="20180811020321" recipe_name="amzn2 ami" recipe_id="c652686a-2415-9819-65fb-4dee-9792-289d-1e2846bd"

The following is an example of /etc/system-release for the current version of AL2.

[ec2-user ~]$ cat /etc/system-release AL2

The following is an example of /etc/os-release for AL2.

[ec2-user ~]$ cat /etc/os-release NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/"

Amazon Linux AMI

The following is an example of /etc/image-id for the current Amazon Linux AMI.

[ec2-user ~]$ cat /etc/image-id image_name="amzn-ami-hvm" image_version="2018.03" image_arch="x86_64" image_file="amzn-ami-hvm-2018.03.0.20180811-x86_64.ext4.gpt" image_stamp="cc81-f2f3" image_date="20180811012746" recipe_name="amzn ami" recipe_id="5b283820-dc60-a7ea-d436-39fa-439f-02ea-5c802dbd"

The following is an example of /etc/system-release for the current Amazon Linux AMI.

[ec2-user ~]$ cat /etc/system-release Amazon Linux AMI release 2018.03

在本頁面

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。