dnf refreshes metadata whenever its cache expires, so dnf upgrade alone does what apt update && apt upgrade does. Fedora 41 1,480 and later ship DNF 5, a C++ rewrite; RHEL 10 664 and its rebuilds still use DNF 4.20; the verbs below work in both. These dnf commands are for RHEL-family systems and could not be run on this book's Ubuntu 225 machine, so they appear without output.
| Task | apt | dnf |
|---|---|---|
| Which package owns a file | dpkg -S /path | dnf provides /path |
| Remove orphans | apt autoremove | dnf autoremove |
| Undo a transaction | (none) | dnf history undo 42 |
dnf history is the one real capability APT lacks: numbered transactions you can inspect and undo. PHP versions come as module streams, of which you enable one. None is 8.5, so add EPEL and Remi Collet's repository with the commands his wizard prints for EL 10 (use 9 for EL 9).
sudo dnf config-manager --set-enabled crb # CodeReady Builder, required by EPEL
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-10.rpm
sudo dnf module switch-to php:remi-8.5
sudo dnf install httpd mysql8.4-server php-fpm php-mysqlnd php-mbstring php-xmlSnap packages bundle their dependencies and update themselves; Certbot 1,690 recommends that route (sudo snap install --classic certbot, Let's Encrypt). Flatpak 121,050 targets desktop applications. Keep both out of the web stack's critical path: self-updating is a surprise in production.
On Debian 319 and Ubuntu the stack is one command (on Debian 13 and Ubuntu 24.04, after adding Sury). Every package was already present here, so a simulated run just reports the versions.
sudo apt install -s apache2 mysql-server php8.5-fpm php8.5-mysql php8.5-mbstring \
php8.5-xml php8.5-curl php8.5-zipapache2 is already the newest version (2.4.66-2ubuntu2.4). mysql-server is already the newest version (9.7.2-1ubuntu26.04). php8.5-fpm is already the newest version (8.5.4-0ubuntu1.3). ...