Tools
Log in
English

Learn to codeSecurity check

Pending security updates

HighL04Linux servers

Check for fixed packages you have not installed yet and install them.

What is the risk

Published bugs land in automated attack tools within days. The gap between a fix coming out and you installing it is the riskiest time.

Install updates quickly for packages that face the network, such as OpenSSH, OpenSSL, nginx and the kernel.

How to check

Debian / Ubuntu

sudo apt update
apt list --upgradable 2>/dev/null
apt list --upgradable 2>/dev/null | grep -- -security

The last line shows only packages from the security repository.

RHEL / Rocky / Alma

sudo dnf check-update
sudo dnf updateinfo list --security

How to fix

Debian / Ubuntu

sudo apt update && sudo apt upgrade
sudo needrestart -r l

The second line lists services still using old libraries (install it with sudo apt install needrestart if missing).

RHEL / Rocky / Alma

sudo dnf upgrade --security
sudo dnf needs-restarting -s

Debian / Ubuntu

sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades

Installs security updates automatically every day.

RHEL / Rocky / Alma

sudo dnf install dnf-automatic
sudo sed -i 's/^upgrade_type.*/upgrade_type = security/; s/^apply_updates.*/apply_updates = yes/' /etc/dnf/automatic.conf
sudo systemctl enable --now dnf-automatic.timer

For RHEL, Rocky and Alma 8 and 9.

How to prevent it

  • After updating, check whether services or the server need a restart (L05).
  • Take a snapshot or backup of important servers first.
  • Releases past end of support get no more updates. Move to a supported release.

Check again after fixing

Debian / Ubuntu

apt list --upgradable 2>/dev/null | grep -- -security

No output means you are up to date.

RHEL / Rocky / Alma

sudo dnf updateinfo list --security

Run the downloaded check again and make sure this item passes.

Related CVEs

CVE-2024-6387

Security check home