Seleziona le tue preferenze relative ai cookie

Utilizziamo cookie essenziali e strumenti simili necessari per fornire il nostro sito e i nostri servizi. Utilizziamo i cookie prestazionali per raccogliere statistiche anonime in modo da poter capire come i clienti utilizzano il nostro sito e apportare miglioramenti. I cookie essenziali non possono essere disattivati, ma puoi fare clic su \"Personalizza\" o \"Rifiuta\" per rifiutare i cookie prestazionali.

Se sei d'accordo, AWS e le terze parti approvate utilizzeranno i cookie anche per fornire utili funzionalità del sito, ricordare le tue preferenze e visualizzare contenuti pertinenti, inclusa la pubblicità pertinente. Per continuare senza accettare questi cookie, fai clic su \"Continua\" o \"Rifiuta\". Per effettuare scelte più dettagliate o saperne di più, fai clic su \"Personalizza\".

Identify AL2 instances

Modalità Focus
Identify AL2 instances - Amazon Linux 2
Questa pagina non è tradotta nella tua lingua. Richiedi traduzione

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

In questa pagina

PrivacyCondizioni del sitoPreferenze cookie
© 2025, Amazon Web Services, Inc. o società affiliate. Tutti i diritti riservati.