You’ll often see two of common ways of updating Debian and Ubuntu-based distributions:
- sudo apt-get update && sudo apt-get upgrade
- sudo apt-get update && sudo apt-get dist-upgrade
The apt-get update part updates the local package cache and thus tells your system about the packages that can be upgraded.
However, many Linux users get confused between the use of apt-get upgrade and apt-get dist-upgrade.
Are they the same, or is there a difference? In which cases should you use apt-get upgrade and when should you use apt-get dist-upgrade?
In this article, I’ll explain the difference between apt-get upgrade and dist-upgrade. I’ll also discuss how apt upgrade and apt full-upgrade do things differently.
Difference between apt-get upgrade vs apt-get dist-upgrade
Both upgrade and dist-upgrade are used for upgrading the installed packages on the system. However, apt-get upgrade command cannot install a new package or remove an installed package from the system. The dist-upgrade, on the other hand, can install new packages or remove existing packages if required.
It also means you cannot upgrade the Linux kernel version with apt-get upgrade. Why? Your system keeps at least two kernels at a time. Because when there is a new kernel version is available, it is installed along with the one which is already in use.
Since it involves installing new packages, apt-get upgrade doesn’t upgrade the kernel.