What sudo apt update Does
It contacts every repository configured in /etc/apt/sources.list and the files in /etc/apt/sources.list.d/, downloads their current package lists, and stores them under /var/lib/apt/lists/. After that, apt knows which newer versions exist. It does not install or change any package. To install the updates:
sudo apt update
sudo apt upgradeThe commands are the same on Debian and Ubuntu. Ubuntu 24.04 and later keep the main repository list in ubuntu.sources inside the sources.list.d folder rather than in sources.list.
Read the Output
- Hit: the list has not changed since the last run.
- Get: a newer list was downloaded.
- Ign: an optional file was not found; usually harmless.
- Err or W: a repository failed; see the errors below.
The last line says how many packages can be upgraded and suggests a command to see them:
apt list --upgradableupdate, upgrade, and full-upgrade
| Command | What it does |
|---|---|
apt update | Refreshes package lists only |
apt upgrade | Installs newer versions, never removes |
apt full- | Also removes packages when needed |
apt autoremove | Removes dependencies nothing needs |
full-upgrade stays within your release; it is not a move to the next Ubuntu version. Before you answer yes, read the list of packages it plans to remove.
Packages Kept Back
When apt says some packages have been kept back, finishing their upgrade needs a step apt upgrade will not take, such as removing a package. On Ubuntu, phased updates also hold some packages back: a new version reaches a growing share of machines over a few days, and yours gets it later. Waiting is the normal answer. For a package kept back for another reason, sudo apt install package upgrades it; read what else it plans to change before you confirm.
Packages you held on purpose are listed by apt-mark showhold. Release one with sudo apt-mark unhold package.
Does the Server Need a Reboot?
A kernel or core library update creates the marker file /var/run/reboot-required. If it exists, a reboot is due:
ls /var/run/reboot-required
cat /var/run/reboot-required.pkgsThe second file lists the packages that asked for it. See how to reboot a Linux server for a safe restart.
A Safe Routine on a Server
- Take a snapshot first; see snapshot vs backup.
- Run
sudo apt update, thenapt list --upgradable. - Run
sudo apt upgradeand read the summary before confirming. - Run
sudo apt autoremoveto clear old dependencies. - Reboot if the marker file exists, then check your services with systemctl.
Run long upgrades inside tmux or screen, so a dropped SSH connection does not interrupt them.
Common Errors
- Missing or expired key: the message names a repository and says its signature cannot be checked, often with NO_
PUBKEY or EXPKEYSIG. apt ignores that repository until it has the publisher's current key. Fetch the key the way the publisher documents, or remove the repository file. See add-apt-repository command not found for how keys are stored. - Repository does not have a Release file: the repository no longer serves files for your release, typically an old PPA or a release past its end of life. Remove or correct that entry.
- Could not get lock: another package process is running. See the dpkg lock guide.
- Temporary failure resolving: the server cannot resolve names. Check DNS and the network with the tools in Linux network commands.
- Hash sum mismatch: a mirror was being updated while you downloaded. Retry after a few minutes.
apt or apt-get?
Use apt at the terminal: it shows progress and readable summaries. Scripts should call apt-get, whose output format is kept stable. apt-get dist-upgrade is the older name for full-upgrade.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations