How to Fix Low Disk Space Issues on Ubuntu Linux
apt update and
apt upgrade
One of the most commonly used commands in Linux-based operating systems is
apt update and
apt upgrade.
In Debian-based Linux distributions such as Raspberry Pi OS, Ubuntu, and Debian, software installation and system management are handled through APT (Advanced Package Tool), and these two commands form the foundation of system maintenance.
Although the two commands may appear similar, their roles and purposes are clearly different.
APT is a package management system used by Debian-based Linux
distributions.
It manages software and libraries through centralized repositories and automatically handles installation, updates, dependency resolution, and removal.
Because Raspberry Pi OS is based on Debian, it uses the same APT system.
This allows users to manage software efficiently without manually resolving complex dependencies.
apt update?
apt update
does not update any software packages.
![]() |
| sudo apt update |
apt update
Refreshes the package index
Retrieves the latest version information from repositories
Checks which installed packages have available updates
In simple terms,
apt update updates the
list of available packages,
not the packages themselves.
Reads repository definitions from
/etc/apt/sources.list and
/etc/apt/sources.list.d/
Downloads the latest package metadata
Updates the local package database
No installed software is modified during this process.
sudo apt update
After running this command, the system will report how many packages can be upgraded, but no actual changes will occur.
apt upgrade?
apt upgrade
performs the actual update of installed packages.
![]() |
| sudo apt upgrade |
apt upgrade
Upgrades installed packages to their latest versions
Does not remove existing packages
Avoids installing new dependencies if removal is required
This command uses the information gathered by
apt update to apply updates
safely.
Conservative and stability-focused
Skips updates that require package removal
Commonly used on servers and production systems
sudo apt upgrade
Before proceeding, the system displays a list of packages to be upgraded and asks for confirmation.
apt update and
apt upgrade| Category | apt update | apt upgrade |
|---|---|---|
| Function | Refresh package list | Upgrade installed packages |
| Changes system files | No | Yes |
| Affects software | No | Yes |
| Execution order | First | After update |
| Purpose | Check availability | Apply updates |
In short:
apt update = refresh information
apt upgrade = apply updates
APT always relies on the
latest package information.
If apt update is not executed
first, apt upgrade may use
outdated data.
sudo apt update
sudo apt upgrade
This sequence is the standard and safest way to maintain Debian-based systems, including Raspberry Pi OS.
Raspberry Pi systems often run for long periods and rely on SD card
storage.
Regular updates help maintain system reliability and compatibility.
Benefits include:
Bug fixes
Performance improvements
Security updates
Hardware driver enhancements
Routine updates help ensure a smooth and stable Raspberry Pi environment.
apt upgrade
Avoid powering off the system during updates
Ensure sufficient free disk space
Avoid updating during critical tasks
Because Raspberry Pi uses SD cards, storage health and available space are especially important.
apt full-upgrade
There is also a command called
apt full-upgrade.
Allows package removal if required
Handles dependency changes more aggressively
May update kernels and core components
For beginners and learning environments, the combination of
apt update and
apt upgrade is generally the
safest choice.
![]() |
| sudo apt full-upgrade |
apt update and
apt upgrade are essential
commands for Linux system maintenance.
However, their roles and purposes are clearly different.
apt update
refreshes package information
apt upgrade
updates installed software
For Raspberry Pi OS users, simply understanding the difference between these two commands can significantly improve their understanding of Linux system management.