Find us on social media
APTUpdatesUbuntu5 min read
Update the operating system
Keep your VPS up to date with the latest security patches and package updates on Ubuntu and Debian.
Keeping your VPS updated is essential for security and stability. This guide covers Ubuntu and Debian.
Step 1 — Update the package list
bash
sudo apt updateThis downloads the latest information from configured repositories.
Step 2 — Install available updates
bash
sudo apt upgrade -yThe -y flag automatically confirms the installation.
Step 3 — Upgrade packages with new dependencies
bash
sudo apt full-upgrade -yThis command also installs or removes packages if necessary to resolve dependencies.
Step 4 — Clean obsolete packages
bash
sudo apt autoremove -y
sudo apt autocleanConfigure automatic security updates
To have security patches install automatically:
bash
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure -plow unattended-upgradesSelect "Yes" when asked to enable automatic updates.
Verify the configuration:
bash
cat /etc/apt/apt.conf.d/20auto-upgradesYou should see:
terminal
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";For AlmaLinux / Rocky Linux
If your VPS uses AlmaLinux:
bash
sudo dnf update -y
sudo dnf install dnf-automatic -y
sudo systemctl enable --now dnf-automatic-install.timerReboot if necessary
If the kernel was updated:
bash
sudo rebootReconnect via SSH after a few seconds. Verify the active kernel with uname -r.
Was this guide helpful?