From the Amazon Linux 2023 documentation:

You can change the value of releasever using one of the following methods. These methods are listed in descending system priority. This means that method 1 overrides methods 2 and 3, and method 2 overrides method 3.

  1. The value in the command line flag, --releasever=latest, if it's used.
  2. The value that's specified in the override variable file, /etc/dnf/vars/releasever, if it's set.
  3. The currently installed version of the system-release package.

So releasever can be found with the one-liner: cat /etc/dnf/vars/releasever || rpm -q system-release

Original answer

Can be found like so: cat /var/log/dnf.log | grep -i "ddebug releasever:" | rev | cut -f 1 -d " " | rev | tail -n 1

To double check run dnf list system-release. The numbers should be identical. The packages amazon-linux-repo-s3 or kernel-livepatch-repo-s3 can be used in place of system-release.

Answer from Uberhumus on Stack Overflow
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › updating al2023 › manage package and operating system updates in al2023
Manage package and operating system updates in AL2023 - Amazon Linux 2023
The dnf check-update command is now used to check updates available in the 2023.1.20230628 release. Applying package updates is a privileged operation. Although elevating privileges is typically not required when running in a container, if running in a non-containerized environment such as an Amazon EC2 instance, you can check for updates without elevating privileges. $ dnf check-update --releasever=2023.1.20230628 Amazon Linux ...
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › updating al2023
Updating AL2023 - Amazon Linux 2023
May 22, 2026 - Checking for, getting notified of, and managing package and OS updates in AL2023.
Discussions

How to find Amazon Linux 2023 version? - Stack Overflow
When I run the dnf check-update command on my Amazon Linux server it appears as follows: Amazon Linux 2023 repository 361 B/s | 3.6 kB 00:10 ============... More on stackoverflow.com
🌐 stackoverflow.com
Amazon Linux 2023 new release - never happens.
Version 2023.1.20230825: Run "/usr/bin/dnf check-release-update" for full release and version update info ... WARNING: A newer release of "Amazon Linux" is available. Available Versions: Version 2023.1.20230825: Run the following command to upgrade to 2023.1.20230825: dnf upgrade ... More on repost.aws
🌐 repost.aws
1
0
September 5, 2023
What's the best way to migrate our EC2 instances from Amazon Linux 1 to Amazon Linux 2?
By making new ones and reinstalling everything. You did script / document everything along the way right? ;) More on reddit.com
🌐 r/aws
17
27
December 11, 2023
What are your experiences with patching Amazon Linux 2023?
SSM patch manager. It's also a hint to migrate away from plain old VMs and start exploring other platforms to re-architect to. Or you can ignore the AWS reps and continue running dnf. More on reddit.com
🌐 r/aws
2
1
August 13, 2024
🌐
AWS re:Post
repost.aws › knowledge-center › ec2-linux-update-security-patches
Update EC2 Linux with the latest updates | AWS re:Post
3 weeks ago - If you run AL2, then migrate to Amazon Linux 2023 (AL2023) before the end-of-support date. Test migrated applications in a non-production environment first. AL2023 uses versioned repositories. By default, each AL2023 Amazon Machine Image (AMI) is locked to a specific repository version. AL2 uses the yum command and AL2023 uses the dnf command.
🌐
GitHub
github.com › amazonlinux › amazon-linux-2023 › discussions › 395
Automatic upgrade strategy · amazonlinux/amazon-linux-2023 · Discussion #395
Available Versions: Version 2023.1.20230705: Run the following command to upgrade to 2023.1.20230705: dnf upgrade --releasever=2023.1.20230705 Release notes: https://docs.aws.amazon.com/linux/al2023/release-notes/relnotes.html
Author   amazonlinux
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › security and compliance in amazon linux 2023 › applying security updates in-place
Applying security updates in-place - Amazon Linux 2023
April 20, 2026 - To apply the updates for affected packages only up to the version mention in the advisory, use the dnf upgrade-minimal command while using the --advisory option to specify the advisory. The following example is running dnf upgrade-minimal in an AL2023 version 2023.0.20230315 container. $ dnf upgrade-minimal -y --releasever=2023.1.20230628 --advisory ALAS2023-2023-193 Amazon Linux ...
Top answer
1 of 2
4

From the Amazon Linux 2023 documentation:

You can change the value of releasever using one of the following methods. These methods are listed in descending system priority. This means that method 1 overrides methods 2 and 3, and method 2 overrides method 3.

  1. The value in the command line flag, --releasever=latest, if it's used.
  2. The value that's specified in the override variable file, /etc/dnf/vars/releasever, if it's set.
  3. The currently installed version of the system-release package.

So releasever can be found with the one-liner: cat /etc/dnf/vars/releasever || rpm -q system-release

Original answer

Can be found like so: cat /var/log/dnf.log | grep -i "ddebug releasever:" | rev | cut -f 1 -d " " | rev | tail -n 1

To double check run dnf list system-release. The numbers should be identical. The packages amazon-linux-repo-s3 or kernel-livepatch-repo-s3 can be used in place of system-release.

2 of 2
0

I see it in eg:

% cat /etc/amazon-linux-release
Amazon Linux release 2023.5.20240805 (Amazon Linux)

% cat /etc/os-release
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023.5.20240805"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/amazon-linux-2023/"
DOCUMENTATION_URL="https://docs.aws.amazon.com/linux/"
SUPPORT_URL="https://aws.amazon.com/premiumsupport/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
VENDOR_NAME="AWS"
VENDOR_URL="https://aws.amazon.com/"
SUPPORT_END="2028-03-15"

% cat /etc/system-release
Amazon Linux release 2023.5.20240805 (Amazon Linux)

% rpm -q system-release
system-release-2023.5.20240805-0.amzn2023.noarch

% rpm -q system-release --qf "%{VERSION}\n"
2023.5.20240805

% dnf list system-release
Last metadata expiration check: 3:03:53 ago on Fri Nov  7 10:01:06 2025.
Installed Packages
system-release.noarch    2023.5.20240805-0.amzn2023     @amazonlinux
Find elsewhere
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › updating al2023 › deterministic upgrades through versioned repositories on al2023 › using deterministic upgrades through versioned repositories
Using Deterministic upgrades through versioned repositories - Amazon Linux 2023
For information on restricting ... security updates in-place · For patching in-place, you can use the dnf package manager. When you run the dnf upgrade command, the system checks for upgrades in the repository that the releasever variable specifies. A valid releasever is either latest or a date-stamped version such as 2023.12.20...
🌐
GitHub
github.com › amazonlinux › amazon-linux-2023
GitHub - amazonlinux/amazon-linux-2023: Amazon Linux 2023 · GitHub
# docker pull public.ecr.aws/amazonlinux/amazonlinux:2023 ... Note If seccomp is enabled, you might get an EPERM error when using Amazon Linux container images. To run a container without the default seccomp profile, add the following option ...
Starred by 616 users
Forked by 48 users
Languages   HTML
🌐
Amazon
alas.aws.amazon.com › announcements › 2026-015.html
Announcement 2026-015
February 4, 2026 - If you are performing in-place patching of Amazon Linux 2023, instances may be affected by an issue in the check-release-update command [1] of the DNF package manager that results in it returning a release, which is not the latest. This command is run on an instance to determine what release ...
🌐
Amazon Web Services
aws.amazon.com › compute › linux from aws › amazon linux 2023 faqs
Amazon Linux 2023 FAQs
2 weeks ago - You can change SELinux settings ... this command on launch from cloud-init userdata. When the instance is rebooted, it will remember and use the SELinux setting that was specified the first time unless you change it. Please refer to the AL2023 documentation for more details. Please see the Amazon Linux 2023 Release Notes ...
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › updating al2023 › updating the linux kernel on al2023
Updating the Linux Kernel on AL2023 - Amazon Linux 2023
2 weeks ago - Update the Linux kernel to latest versions to benefit from new features and performance improvements.
🌐
ManageEngine
manageengine.com › patch-management › amazon-linux-patching.html
Amazon Linux Security Patch Updates | Manual and automated Linux patching.
This will download information about the latest packages from the Amazon Linux repositories. Once the package list is updated, you can check if any updates are available by running the following command: sudo dnf check-update
🌐
DjaoDjin
djaodjin.com › blog › aws-migrate-amazon-linux-2023.blog.html
Upgrading to Amazon Linux 2023 | DjaoDjin
January 4, 2024 - Updates Information Summary: available ...azon.com/linux/amazon-linux-2023 ~~ V~' '-> ~~~ / ~~._. _/ _/ _/ _/m/' Last login: Fri May 9 22:22:15 2025 from 1.1.1.1 · You can list all security updates, and the details of each security update with the following commands....
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › what is amazon linux 2023? › release cadence
Release cadence - Amazon Linux 2023
May 22, 2026 - Learn about the Amazon Linux 2023 release cadence, support phases, and update mechanisms. Understand major and minor version releases, long-term support policy, and how to consume new releases.
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › updating al2023 › kernel live patching on al2023
Kernel Live Patching on AL2023 - Amazon Linux 2023
May 22, 2026 - The Amazon Linux Security Center might not list kernel live patches that address bugs. You can also discover the available kernel live patches for advisories and CVEs using the command line. Use the following command. $ sudo dnf updateinfo list Last metadata expiration check: 1:06:23 ago on Mon 13 Feb 2023 ...