๐ ๏ธ How to Update Ubuntu Server
โ One-liner:
sudo apt update && sudo apt upgrade -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt autoclean
๐ Details:
1. Start with the basic update command:
sudo apt update && sudo apt upgrade -y
This updates:
- Libraries (e.g. OpenSSL)
- Services (e.g. SSH, systemd)
- Command-line tools (e.g. curl, wget)
2. Update the system kernel:
sudo apt full-upgrade -y
Upgrading the kernel often includes critical security patches (like Spectre, Meltdown, etc.)
3. Clean up old unused packages:
sudo apt autoremove -y
sudo apt autoclean
This frees up space and keeps your system tidy.
ย
๐ Potential problems
๐ ๏ธ Ubuntu Update Issue: 1 not upgraded
Sometimes after running sudo apt update && sudo apt upgrade, you might see this message:
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
This means that one package couldnโt be upgraded automatically.
โ Why does this happen?
Usually, itโs because:
- The package requires new dependencies
- The upgrade may remove or replace other packages
- Itโs being held back by the system for safety reasons
โ How to find and fix it
Use the following command to list packages that were not upgraded:
apt list --upgradable
Example output:
Listing... Done
ubuntu-drivers-common/noble-updates 1:0.9.7.6ubuntu3.2 amd64 [upgradable from: 1:0.9.7.6ubuntu3.1]
N: There are 2 additional versions. Please use the '-a' switch to see them.
Now you can simply install the package manually:
sudo apt install ubuntu-drivers-common
Thatโs it โ problem solved!