Linux Patch Management: A Practical Process for Ubuntu, Debian and RHEL
Linux patch management is the routine of finding, testing, installing, and verifying updates across your servers on a predictable schedule. On Ubuntu and Debian that means apt and unattended-upgrades; on RHEL and its rebuilds it means dnf and dnf-automatic. The tools are simple. The hard part is the process around them: knowing what you run, deciding what to patch first, rolling changes out in stages, and proving that the updates are actually live.
This guide sets out a process that works for a fleet of a few servers or a few hundred.
Key takeaways
- Start with an inventory: every server, its distribution, its release, and its end-of-life date.
- Automate security updates where you can, but stage them: test servers first, then production.
- Prioritize by exploitability. Fixes for vulnerabilities in CISA's Known Exploited Vulnerabilities catalog come first.
- An update isn't finished until the service is restarted or the server is rebooted, and you've verified the new version is running.
- Track release end-of-life dates, because an unsupported release can't be patched at all.
Why Linux patching needs a process
NIST describes patching as routine preventive maintenance rather than an emergency activity, and recommends an organization-wide strategy to make it manageable (NIST SP 800-40 Rev. 4, April 2022). In practice, unpatched Linux servers usually come from gaps in process rather than missing tools:
- Servers nobody remembered existed
- Updates installed but services never restarted, so the old library stays in memory
- Automatic updates disabled after one bad upgrade and never re-enabled
- Releases that went past end-of-life and stopped receiving fixes
Step 1: Build an inventory
You can't patch what you don't know about. For each server, record:
- Hostname and role (web, database, file, hypervisor)
- Distribution and release, for example Ubuntu 24.04, Debian 12, or RHEL 9
- Kernel version
- Who owns it, and its maintenance window
- The release's end-of-life date
cat /etc/os-release
uname -r
uptime
Configuration management tools such as Ansible can collect this across the whole fleet in one run.
Step 2: Decide what to patch first
Not every update is equally urgent. A workable order is:
- Actively exploited vulnerabilities: anything in the CISA Known Exploited Vulnerabilities catalog. CISA recommends that organizations use the catalog as an input to their vulnerability management prioritization.
- Critical and high-severity security updates on internet-facing servers.
- Remaining security updates on internal servers.
- Bug fixes and feature updates, in the regular maintenance window.
Step 3: See what's pending
Ubuntu and Debian
sudo apt update
apt list --upgradable
RHEL, Rocky Linux and AlmaLinux
sudo dnf check-update
sudo dnf updateinfo list --security
dnf updateinfo separates security advisories from other updates, which helps when you only want to apply security fixes between maintenance windows.
Step 4: Automate security updates
Ubuntu and Debian: unattended-upgrades
sudo apt install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades
By default it installs updates from the security pocket only. Check /etc/apt/apt.conf.d/50unattended-upgrades to confirm which origins are allowed, whether automatic reboots are enabled, and where reports are emailed. Then do a dry run:
sudo unattended-upgrade --dry-run --debug
RHEL: dnf-automatic
sudo dnf install dnf-automatic
sudo systemctl enable --now dnf-automatic.timer
In /etc/dnf/automatic.conf, set upgrade_type = security to limit automatic installs to security advisories, and apply_updates = yes to install rather than just download.
Step 5: Stage the rollout
Automatic updates are safest when they don't hit every server at once:
- Ring 0, test: non-production copies of your main workloads, updated first
- Ring 1, low-risk production: redundant or easily rebuilt servers, a few days later
- Ring 2, critical production: databases and single points of failure, in a maintenance window with a rollback plan
Step 6: Restart services and reboot
Installing an updated library doesn't protect running processes that still use the old one. After updates:
- On Ubuntu and Debian,
needrestartlists services running outdated code, and can restart them - On RHEL,
dnf needs-restarting -rreports whether a reboot is required, anddnf needs-restarting -slists services to restart - Kernel updates need a reboot, unless you use a live-patching service such as Canonical Livepatch or kpatch on RHEL
# Ubuntu / Debian
[ -f /var/run/reboot-required ] && cat /var/run/reboot-required
# RHEL family
sudo dnf needs-restarting -r
Schedule reboots in the maintenance window rather than letting them pile up. A server with 400 days of uptime is usually a server running an old kernel.
Step 7: Verify and record
Close each cycle by checking that the updates are really in place:
- Confirm the package versions changed:
apt policy <package>orrpm -q <package> - Confirm the running kernel matches the installed one:
uname -r - Check the application still works, not just that the server responds to ping
- Record what was patched, when, and any failures
Step 8: Plan for end-of-life
An unsupported release can't be patched, however good your process is. Two examples of current life cycles:
- Ubuntu LTS: 5 years of standard security maintenance, extendable with Ubuntu Pro's Expanded Security Maintenance (Ubuntu release cycle)
- RHEL: a 10-year life cycle for each major release (Red Hat life cycle policy)
A monthly patch cycle at a glance
| Week | Task |
|---|---|
| Continuous | Automatic security updates on test and low-risk servers |
| Week 1 | Review pending updates and KEV entries; patch test servers |
| Week 2 | Patch low-risk production; check for regressions |
| Week 3 | Patch critical production in the maintenance window; reboot as needed |
| Week 4 | Verify versions and kernels; record results; review end-of-life list |
Frequently asked questions
Should I enable automatic updates on production Linux servers?
For security updates, usually yes, as long as you stage them and test first. Limit automatic installs to security updates, and keep feature updates and major upgrades for planned maintenance.
How often should Linux servers be rebooted?
Whenever a kernel or core library update requires it, which in practice is often monthly. If uptime matters, use live patching for the kernel and design services so one server can reboot without an outage.
Is apt upgrade or apt full-upgrade safer?
apt upgrade never removes packages, so it's the safer default for routine patching. apt full-upgrade can remove packages to resolve dependencies and is better kept for planned maintenance.
Get help with Linux patching
Our Linux administration service runs this process for Ubuntu, Debian, and RHEL fleets, with monthly reports on patch status and end-of-life dates. For the wider routine around it, see the IT administration checklist.