Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

dnf cannot install MySQL on Amazon Linux 2023

ErrorNo such command: check-release-update

Short answer

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server. Install those, start mariadb, and run mysql_secure_installation. If a package name is missing, the AMI may be pinned to an older repository version.

  • Applies to Amazon Linux 2023, dnf 4
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask dnf what database packages the enabled repositories offer.

    dnf search mariadb
    dnf search mysql
  2. 2Match what you see, then jump to its fix

    1. 1dnf finds no mysql-server packageYou asked for a MySQL package name, but AL2023 ships MariaDBFix
    2. 2A package name from the docs is missing, or dnf offers old versionsThe instance is locked to an older repository versionFix
    3. 3No such command: check-release-updateInside a container image, dnf check-release-update is not presentFix

What does the error look like?

  • No such command: check-release-update
  • dnf cannot find a mysql-server package on Amazon Linux 2023

Cause 1 of 3

You asked for a MySQL package name, but AL2023 ships MariaDB

1Check

AWS's AL2023 LAMP tutorial installs MariaDB as mariadb105-server. See what the repo holds.

dnf info mariadb105-server

2Fix

Install the MariaDB server package, start it and secure it. It speaks the MySQL protocol, so most MySQL clients and apps connect to it.

sudo dnf install mariadb105-server
sudo systemctl start mariadb
sudo mysql_secure_installation

3Verify

The service is active and the client connects.

sudo systemctl status mariadb
sudo mysql -e "SELECT VERSION();"

Confirmed by docs.aws.amazon.com

Did this fix it?

Cause 2 of 3

The instance is locked to an older repository version

1Check

AL2023 AMIs are locked to one version of the Amazon Linux repository. Ask whether a newer one exists.

sudo dnf check-release-update

2Fix

Move dnf to the latest repository version, or launch a newer AL2023 AMI. Apply the whole update, not only selected packages.

sudo dnf upgrade --releasever=latest

3Verify

The package is now found.

dnf info mariadb105-server

Confirmed by docs.aws.amazon.com

Did this fix it?

Cause 3 of 3

Inside a container image, dnf check-release-update is not present

1Check

AL2023 container images do not include that command by default.

dnf check-release-update

2Fix

Install the dnf plugin first, or pass --releasever=latest directly to the command you run.

dnf install -y 'dnf-command(check-release-update)'
dnf --releasever=latest check-update

3Verify

The check now runs.

dnf check-release-update

Confirmed by docs.aws.amazon.com

Did this fix it?

How do I stop it coming back?

  • Look up package names in the AL2023 user guide before copying commands written for Amazon Linux 2 or Ubuntu.
  • Rebuild images from the latest AL2023 base on a schedule.
  • For production, consider a managed database such as Amazon RDS instead of a self-run server.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.