Rocky Linux Patch Management — CVE-Aware Fleet Updates
Rocky Linux arrived as the community-led answer to Red Hat’s decision to convert CentOS Linux into the upstream-of-RHEL Stream model. It’s a bug-for-bug RHEL clone, freely distributed, with a release and support cadence that mirrors Red Hat’s. For fleets that ran CentOS Linux for its stability profile, Rocky is the closest like-for-like successor — and that means the patching workflow is the same shape as on RHEL or any other downstream rebuild.
This page covers the actual dnf commands for patching Rocky, how it fits next to RHEL and AlmaLinux in a mixed fleet, the migration paths from CentOS, and where SysWard fits on top.
Core Rocky Linux Patching Commands
The Rocky patching workflow is identical to RHEL’s because the package manager and repo layout are intentionally identical. The four commands that matter:
# Refresh the package metadata and list available updates
sudo dnf check-update
# Apply all available updates
sudo dnf upgrade -y
# Apply only security advisories
sudo dnf upgrade --security -y
# Check whether a reboot is required after the update
sudo dnf needs-restarting -r
dnf upgrade and dnf update are aliases. The --security flag filters to advisories tagged as security; --bugfix and --enhancement filter to those categories. To target a specific CVE, --cve <CVE-ID> applies only the package that addresses it.
For one-off package upgrades: sudo dnf upgrade <package>. The transaction history is your rollback path:
sudo dnf history # list transactions
sudo dnf history info <id> # what changed in a transaction
sudo dnf history undo <id> # reverse it
RHEL Compatibility and Mixed Fleets
Rocky’s compatibility goal is bug-for-bug parity with RHEL. In practical terms:
- Packages built for RHEL run on Rocky without modification, and vice versa.
- Repo layouts are equivalent — BaseOS, AppStream, PowerTools / CRB, EPEL on top.
- Subscription mechanics differ — Rocky doesn’t require subscription-manager, and there’s no Red Hat customer portal to register against.
For mixed Rocky/RHEL fleets, this compatibility means a single patch management workflow covers both. The same dnf upgrade --security runs on both, the same CVE feed matches the installed packages on both, and the same group rollouts work across both. The differences are operational: Red Hat customers have access to RHEL’s official errata feed and Red Hat Insights; Rocky users rely on the Rocky errata team and community channels.
Migrating from CentOS to Rocky
Rocky ships migrate2rocky.sh for in-place migration from CentOS Linux 8 / 8 Stream. The basic flow:
# As root, on a CentOS host
curl -O https://raw.githubusercontent.com/rocky-linux/rocky-tools/main/migrate2rocky/migrate2rocky.sh
chmod +x migrate2rocky.sh
sudo ./migrate2rocky.sh -r
sudo reboot
What the script actually does: swaps the CentOS repo configuration for Rocky’s, replaces a handful of distro-identifying packages (release packages, branding), and runs dnf distro-sync to align package versions with Rocky’s current point release.
Before running it:
- Snapshot the VM or take a full backup of bare-metal hosts. Migrations are usually clean, but the recovery path matters more than the success path.
- Confirm third-party repos have packages compatible with Rocky. EPEL works directly. Some vendor repos pin to RHEL only — check before migrating.
- Pilot on a non-critical host first. The script handles edge cases well; running it once on staging exposes the ones that affect your specific package mix.
For CentOS 7 (which reached EOL in June 2024), there’s no in-place upgrade to Rocky 8 — the path is a clean reinstall onto Rocky 8 or 9. For CentOS 9 Stream → Rocky 9, the same migrate2rocky.sh flow applies with -r (or the equivalent for 9).
Automating with dnf-automatic
dnf-automatic is the per-host automation primitive. Install and enable:
sudo dnf install -y dnf-automatic
sudo systemctl enable --now dnf-automatic.timer
Configuration lives in /etc/dnf/automatic.conf:
[commands]
upgrade_type = security
download_updates = yes
apply_updates = yes
[emitters]
emit_via = stdio
The systemd timer triggers it daily by default. Logs go to the journal:
journalctl -u dnf-automatic.service --since "24 hours ago"
Like every per-host automation tool, dnf-automatic applies updates correctly on the box it runs on but offers no fleet-wide picture. To answer “are all Rocky hosts in production picking up security updates on the right cadence?” you need an external inventory.
Patching Cadence and Maintenance Windows
A workable Rocky patching cadence has three tracks running in parallel:
- Security advisories within days for critical CVEs, within weeks for the rest.
dnf-automatichandles per-host application; central inventory confirms the fleet picture matches what the policy says it should be. - Routine updates monthly in a defined change window, rolling through staging before production.
- Kernel and glibc upgrades on a reboot window.
dnf needs-restarting -rflags hosts pending a reboot. Fleet-wide reboot tracking is where per-host tooling stops being sufficient.
Major version upgrades (Rocky 8 → 9) are their own change event. Rocky doesn’t ship a sanctioned in-place 8 → 9 upgrade path — the standard approach is a clean reinstall onto 9, restoring from configuration management. Pilot on a non-critical host first, and time the move to align with the 8.x EOL schedule.
Common Pitfalls
- Stale dnf cache:
dnf upgradeworks against the local metadata cache.dnf clean expire-cacheforces a refresh if you suspect a stale view. - EPEL drift: if EPEL is enabled, its packages can sometimes outpace the base repos and create conflicts. Pin EPEL to the appropriate release if you hit this.
- Locked packages:
dnf versionlock(from thednf-plugins-corepackage) pins a version. Same problem asapt-mark holdon Debian — easy to set, easy to forget. - Reboot debt: hosts that never reboot stack up kernel updates that aren’t running. A monthly reboot window prevents the surprise outage.
- Mixed CentOS / Rocky inventory during migration: tracking which hosts are on which distro during a multi-month migration is most of the operational risk. Central inventory is the only reliable way.
How SysWard Fits
SysWard treats Rocky, AlmaLinux, RHEL, and CentOS Stream as one fleet. The agent inventories packages on each host, matches them against live CVE feeds, and surfaces what’s exploitable across the lot. Rollouts run via the local dnf with group scheduling, hold windows, and audit logging that per-host tools don’t provide.
For Rocky fleets specifically:
- One view across Rocky, RHEL, and AlmaLinux — no separate dashboards per RHEL-family distro.
- CVE matching against installed packages — a CVE in
httpdonly shows up on hosts where httpd is installed. - Group rollouts for staging → prod, regional rollouts, and held groups during a freeze window.
- Migration visibility during a CentOS → Rocky transition: both distros appear in the same inventory, which makes confirming post-migration patch state straightforward.
- Audit trail for every patch event — host, package, before/after versions, actor.
For more on the CentOS-to-Rocky decision, the CentOS to Rocky Linux migration post on the blog covers the trade-offs and timeline.
Ready to automate this?
SysWard handles Rocky Linux alongside RHEL, AlmaLinux, CentOS Stream, Ubuntu, Debian, and SUSE from one dashboard — start free for 2 servers, no card required. See also CentOS patch management and Red Hat patch management for closely-related distro workflows.
Frequently Asked Questions
How do I patch a Rocky Linux server?
Use sudo dnf check-update to list available updates and sudo dnf upgrade -y to apply them. For security advisories only, sudo dnf upgrade --security -y. After kernel upgrades, sudo dnf needs-restarting -r exits non-zero when a reboot is required. The package manager is identical to the one on RHEL — Rocky aims to be bug-for-bug compatible — so the workflow is interchangeable with RHEL and AlmaLinux.
Is Rocky Linux compatible with RHEL?
Yes — Rocky is built to be a bug-for-bug RHEL clone, the same model the original CentOS Linux followed before CentOS Stream replaced it. Packages built for RHEL run on Rocky without modification; the same applies in the other direction within a major version. This is the design property that makes migrations from CentOS Linux and from RHEL relatively painless, and it’s why mixed Rocky/RHEL fleets work fine under a single patch management tool.
How do I migrate from CentOS to Rocky Linux?
Rocky ships an in-place migration script called migrate2rocky.sh. Run it as root on a CentOS 8 / 8 Stream host: it swaps the CentOS repo configuration for Rocky’s, replaces the distro-identifying packages, and runs dnf distro-sync to align versions. Take a snapshot first — migrations are usually clean but not always — and pilot on a non-critical host before rolling through the fleet. For CentOS 7, the path is a clean reinstall onto Rocky 8 or 9.
How does dnf-automatic work on Rocky?
dnf-automatic is the per-host automation tool. Install it (sudo dnf install -y dnf-automatic), configure /etc/dnf/automatic.conf (the relevant knobs are upgrade_type = security, download_updates = yes, apply_updates = yes), then enable the timer with sudo systemctl enable --now dnf-automatic.timer. It applies updates correctly per host but offers no fleet-wide view — that’s where a central tool fills the gap.
How often should Rocky Linux servers be patched?
Security advisories should be applied within days for critical CVEs and within weeks for the rest. A common compliance benchmark (SOC 2, PCI-DSS) is 30 days for critical vulnerabilities. Routine updates are usually batched monthly behind a change window, with kernel and glibc upgrades held for a reboot window. The cadence that matters most is consistency — a documented schedule that actually runs is easier to audit than an aggressive policy that exists only on paper.
How does SysWard handle Rocky Linux alongside RHEL and AlmaLinux?
SysWard treats Rocky, AlmaLinux, and RHEL as one fleet. The agent inventories packages on each host, the dashboard shows installed packages across the lot, and rollouts run via the local dnf on each host. CVE matching works against the installed package versions regardless of which RHEL-family distro the host runs. During a CentOS-to-Rocky migration, both source and destination hosts appear in the same inventory. Free for 2 servers.
More Solutions
Related Articles
Self-Hosted vs Cloud Patch Management: Pros and Cons
Should you run patch management on-premises or in the cloud? We break down the security, cost, compliance, and operational trade-offs of each approach.
CentOS to Rocky Linux Migration: Patching Considerations
Navigate the CentOS to Rocky Linux migration with a focus on patching continuity. Covers dnf vs yum, repository management, and maintaining security posture.
Ubuntu Server Patching: Complete Automation Guide
Master Ubuntu server patching automation with unattended-upgrades, kernel livepatch, LTS lifecycle planning, and fleet-wide orchestration strategies.