dnf cannot install MySQL on Amazon Linux 2023
No such command: check-release-updateShort 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.
Fix it fast
1Find out which cause you have
Ask dnf what database packages the enabled repositories offer.
dnf search mariadb dnf search mysql2Match what you see, then jump to its fix
- 1
dnf finds no mysql-server packageYou asked for a MySQL package name, but AL2023 ships MariaDBFix - 2
A package name from the docs is missing, or dnf offers old versionsThe instance is locked to an older repository versionFix - 3
No such command: check-release-updateInside a container image, dnf check-release-update is not presentFix
- 1
What does the error look like?
No such command: check-release-updatednf 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-server2Fix
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_installation3Verify
The service is active and the client connects.
sudo systemctl status mariadb
sudo mysql -e "SELECT VERSION();"Confirmed by docs.aws.amazon.com
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-update2Fix
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=latest3Verify
The package is now found.
dnf info mariadb105-serverConfirmed by docs.aws.amazon.com
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-update2Fix
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-update3Verify
The check now runs.
dnf check-release-updateConfirmed by docs.aws.amazon.com
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- ShopGoAn e-commerce aggregator with a Python scraping engine behind its catalog, past 10K Google Play downloads.
Related fixes
Servers
docker run fails: Cannot link to a non running container
Cannot link to a non running container
A --link needs the target container to be running at the moment you start the new one.
4 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix