apt upgrade vs. apt dist-upgrade - The main differences

What is the main difference between the two commands, which are so similar? Here is an explanation of how they differ.

Basically, both commands update the packages and software managed by the system.

apt UPGRADE

The "Upgrade" command, however, is a bit more conservative in its approach to the upgrade and leaves serious dependencies. Thus, if deep dependencies also need to be upgraded, the package is skipped.

Nevertheless, security-relevant patches are always implemented here at any time.

sudo apt upgrade -y

apt DIST-UPGRADE

The DIST-UPGRADE is a little bit harder. Here now also packages are updated which also requires the update of dependencies.

We recommend to make a backup of the system before updating with the "dist-upgrade" command.

sudo apt dist-upgrade -y