The Linux operating system makes it easy to upgrade software packages by letting you run an upgrade command to get the latest version of each piece of software installed on your computer. There are three different ways you can do this: apt-get upgrade, apt-get dist-upgrade, and do-release-upgrade. This article explains how these commands differ, so you can choose the right one to get the latest software upgrades when installing or maintaining your Linux operating system.
If you’re running a Debian or Ubuntu based Linux distribution, you’ve probably come across the apt-get command. apt-get is a powerful package manager that can be used to install, update, and remove software packages. However, there are three different types of upgrades that can be performed with apt-get: upgrade, dist-upgrade, and do-release-upgrade.
So, what’s the difference between them? Upgrade will only install new versions of any packages that have been updated since the last time you ran it (unless you specify -u). Dist-upgrade will upgrade all packages to their latest version as well as upgrading any dependencies they may have. Do-release-upgrade will perform an upgrade on all installed packages and will also attempt to convert your configuration files from one release to another.
For example, if you were running 14.04 LTS (Trusty Tahr) but wanted 16.04 LTS (Xenial Xerus), it would automatically do everything necessary for this transition when performing a do-release-upgrade on your system.
If you run the command apt-get upgrade, it will update all of the packages on your system to their latest versions. However, it will not install any new packages or remove any old ones. This is the most basic form of upgrading your system. You should use this if you want to avoid doing a complete dist-upgrade or a full release upgrade.
Apt-get dist-upgrade: The second option for an upgrade that we’ll discuss is using apt-get dist-upgrade. It will take care of updating all installed packages as well as installing new packages from the repositories and removing old ones (if they are no longer needed).
Do-release-upgrade: The last type of system upgrade we’ll look at is a full release upgrade, which can be done with either dpkg –set -a or do-release-upgrades. The first option does an in place installation and removal, while the latter updates only the running system without doing a fresh installation.
If you’re running a Debian-based Linux distribution, then you’re probably familiar with the apt package manager. The apt package manager is a powerful tool that can be used to install, update, and remove software packages. One of the most common questions I see is what’s the difference between apt-get upgrade and apt-get dist-upgrade? As it turns out, they are two different commands which perform different functions. Let’s break down these commands below:
apt-get upgrade: When executed without any additional options, this command will download any updates for installed packages which have been released since the last time apt was run and installs them automatically.
apt-get dist-upgrade: As you might have guessed from its name, this command performs an upgrade of all installed packages on your system with new versions if they exist on your OS vendor’s release archive (unless there are some major version changes in one or more of those packages).
The apt-get dist-upgrade command is also sometimes called distribution upgrade or full system upgrade. It’s generally safe to use, but should only be performed when you want to ensure that your entire machine has access to the latest security patches and fixes.
The differences in each option
When you run apt-get upgrade, it will look through your installed packages and see if there are any updates available. If there are, it will download and install them. This is the most basic form of updating your system. It’s useful for keeping your package lists up to date with all of the latest security patches and fixes.
Apt-get dist-upgrade is a more complicated version of this command. It does everything that apt-get upgrade does plus it also goes into detail about upgrading each individual package on your system before installing them (which can be helpful).
Do-release-upgrade is the most complicated option, but also the safest one because it checks to make sure that all dependencies are met in order to perform a safe update. It also provides a list of possible issues that may occur during an update as well as whether or not they have been fixed since version XYZ was released (it doesn’t automatically update).
If you’re using a Debian-based Linux distribution, you may be wondering what the difference is between apt-get upgrade, apt-get dist-upgrade, and do-release-upgrade. Here’s a quick rundown apt-get update – refreshes package lists with latest versions of packages
apt-get install – installs packages that are not already installed
apt-get upgrade – upgrades installed packages to their newest version (if available)
apt-get dist-upgrade – upgrades all packages on your system to their newest version (if available)
do-release-upgrade – checks for new Ubuntu releases and prompts you whether or not to perform an upgrade if one is found. It also makes any necessary preparations. However, this command will only work when upgrading from Ubuntu 16.04 LTS to 17.10 or 18.04 LTS because there was no 17.04 release, so it won’t prompt you about upgrading from 16.04 LTS to 17.10/18.04 LTS like it would have had there been a 17 04 release in addition to 16 04 LTS and 17 10/18 04 LTS respectively.