🔹 My suggestion for your box
Since you’re running
- WordPress (PHP + MySQL stack)
- Matomo (PHP, cron jobs)
- Headless React (node build, static served)
👉 Do:
-
apt update && apt list –upgradable
-
Dry-run with apt upgrade –simulate
-
If it looks mostly like libs, system utilities, OpenSSL, curl, etc. → go ahead.
-
If it lists PHP or MySQL, decide whether to:
- Upgrade but keep your configs (press No if it asks about replacing them)
- Or hold them back with apt-mark hold until you’re ready to test.
What APT upgrade can break
- Stays within your current Ubuntu release (24.04 “Noble”).
- Pulls in security patches and bug fixes for installed packages.
- Won’t upgrade to new major versions (no PHP 8.3 → 8.4 jumps, no MySQL 8.0 → 9.0 jumps).
- Usually safe, especially on LTS.
🔹 When Things Break
-
If you’ve customized configs (Apache/Nginx, PHP-FPM, MySQL) and an update asks whether to replace a config file.
- If you press Yes, you may overwrite your tuned settings.
- If you press No, you keep your configs but still get patched binaries. (This is what I recommend.)
-
If you’re running against edge cases (e.g. pinned PHP extensions, custom modules, or non-repo builds).
-
If a package maintainer changes a default behavior in an update (rare, but possible).
🔹 How to make it safe
- Preview first
apt list --upgradable
This shows you exactly what would change.
- Do a dry-run (simulate without applying):
sudo apt upgrade --simulate
- Hold back risky packages
If you see something scary like php8.3-fpm or mysql-server, you can pin it:
sudo apt-mark hold php8.3-fpm mysql-server
- Then run sudo apt upgrade — everything else updates.
- Backups before big moves
- Database: mysqldump -u root -p –all-databases > all_dbs.sql
- Web root configs: tar czf www-backup.tar.gz /var/www/html
- Nginx/Apache configs: tar czf etc-backup.tar.gz /etc/nginx /etc/apache
- Apply the updates
sudo apt upgrade
🔹 Post Updates
-
Restart web stack cleanly
Just to settle deferred changes:
sudo systemctl restart apache2
sudo systemctl restart mysql
sudo systemctl restart php8.3-fpm
- (If you’re not actually using FPM with Apache, that last one is optional.)
- Check status
-
All should show active (running).
-
Quick test
- Open your WordPress site.
- Open Matomo.
- Make sure PHP pages are loading.
