To find vulnerable packages on Linux, start with your distribution’s own tools: apt list --upgradable on Debian and Ubuntu, dnf updateinfo list security on Fedora and RHEL-like systems. Then check whether updated services and the kernel actually restarted, with needrestart or needs-restarting. Container images need separate checks, because host updates do not patch them. Finally, prioritise by exposure and exploitability, not only by the severity score.
CVE and OSV: what the identifiers mean
A CVE (Common Vulnerabilities and Exposures) is a unique identifier for a publicly disclosed vulnerability, such as CVE-2024-6387. The CVE programme (cve.org) assigns identifiers and short descriptions; it does not by itself tell you whether your installed package version is affected.
OSV (osv.dev) is an open vulnerability database and format that records affected versions precisely for each ecosystem: Debian, Ubuntu, Alpine, Rocky Linux, AlmaLinux, as well as language ecosystems like PyPI, npm, Go and crates.io. An OSV entry often aliases one or more CVEs and adds the exact version ranges that are vulnerable and fixed. This makes it well suited for matching against an installed package list.
One important detail: distributions backport fixes. A Debian or RHEL package may keep an old upstream version number but include the security patch. That is why comparing upstream versions alone gives false positives, and why distribution-aware data (security trackers, distribution advisories, OSV distribution entries) is more reliable.
Debian and Ubuntu: apt
Refresh the package index, then list what can be upgraded:
sudo apt update
apt list --upgradable
To see which of those come from the security repository:
apt list --upgradable 2>/dev/null | grep -i security
Apply all updates:
sudo apt upgrade
apt upgrade never removes packages. apt full-upgrade may remove packages to resolve dependencies, so read its output before confirming.
Automatic security updates
unattended-upgrades installs security updates automatically. On Ubuntu it is usually installed by default; on Debian you may need to install and enable it:
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
Check what it would do without changing anything:
sudo unattended-upgrade --dry-run --debug
Logs are in /var/log/unattended-upgrades/. Check them occasionally: a held package or a configuration prompt can silently block updates for weeks. See the Debian wiki on unattended upgrades for configuration details.
On Debian, the debsecan tool can list installed packages affected by known vulnerabilities, using the Debian security tracker.
Fedora, RHEL, Rocky and AlmaLinux: dnf
dnf reads security advisories (updateinfo) published with the repositories:
sudo dnf updateinfo list security
To see details for a specific advisory or CVE:
sudo dnf updateinfo info <ADVISORY-ID>
sudo dnf updateinfo list --cve CVE-2024-6387
Install only security updates:
sudo dnf upgrade --security
For automatic updates, dnf-automatic can be configured to apply security updates only (upgrade_type = security in its configuration file) and enabled with its systemd timer. Note that the quality of security metadata depends on the repository: some community repositories do not publish advisories, so dnf updateinfo may show nothing even when updates exist.
Pending restarts: the step people forget
Installing an update does not replace code already in memory. A running service keeps using the old, vulnerable library until it restarts, and a new kernel is only used after a reboot.
On Debian and Ubuntu, needrestart lists services that use outdated libraries and checks whether the running kernel is older than the installed one:
sudo apt install needrestart
sudo needrestart -r l
The -r l option only lists; without it, needrestart may offer to restart services interactively. Ubuntu also creates /var/run/reboot-required when a reboot is needed.
On RHEL-like systems, needs-restarting comes with the dnf utilities:
sudo needs-restarting -r # is a reboot required?
sudo needs-restarting -s # which services need a restart?
A server that installs patches automatically but never reboots can stay vulnerable to kernel issues for months.
Container images
Packages inside container images are not updated by apt or dnf on the host. Each image has its own operating system layer and libraries, frozen at build time.
To keep containers patched:
- Rebuild regularly from updated base images, and redeploy.
- Pull updated images for third-party software and recreate the containers; pulling alone does not change running containers.
- Scan images with a scanner that uses vulnerability data such as OSV. Google’s OSV-Scanner can scan lockfiles, directories and container images.
- Prefer slim, maintained base images with fewer packages to patch.
Remember that the host still matters: the kernel is shared between host and containers, so host kernel updates and reboots protect containers too.
How to prioritise
A typical server can show dozens of available updates. Patching everything immediately is ideal, but when you have to choose, prioritise with these questions:
- Is it exposed? A vulnerability in a service reachable from the internet (SSH, web server, a database on a public interface) comes before one in a local-only tool.
- Is it known to be exploited? Lists of known exploited vulnerabilities, such as CISA’s KEV catalogue, and exploit prediction scores like EPSS help separate theoretical from practical risk.
- How severe is it? Use the CVSS score and the distribution’s own severity rating, but do not rely on the score alone.
- What does it give an attacker? Remote code execution and privilege escalation come before denial of service, in most cases.
- Is a restart pending? An installed but not active fix is still an open risk.
Also reduce exposure while you wait for a fix: bind databases to 127.0.0.1, restrict ports with the firewall, and disable services you do not use.
How Avanguard helps
Avanguard does not install updates for you; you run the fixes. It helps you see and prioritise:
- The hourly full scan checks OS, kernel, packages and pending updates, and flags packages with known vulnerabilities using the OSV database, missing security updates and pending reboots.
- It also reports exposure that changes priorities, such as databases listening on all interfaces and Docker-published database ports that bypass ufw.
- Each problem becomes a suggestion with severity, an explanation and commands to verify and fix in order with their risk; “Check again” re-runs the check in about 15 seconds. See the Linux vulnerability scanner.
Summary
- Understand the difference: CVE identifies a vulnerability; OSV maps it to affected package versions.
- Debian and Ubuntu:
apt update,apt list --upgradable,unattended-upgrades. - RHEL-like:
dnf updateinfo list security,dnf upgrade --security,dnf-automatic. - Check pending restarts with
needrestart -r lorneeds-restarting -r, and reboot after kernel updates. - Rebuild and rescan container images; host updates do not patch them.
- Prioritise by exposure, known exploitation, severity and impact.