How to upgrade a Debian-based Linux distribution–let me count the ways. There’s an apt-get upgrade, apt-get dist-upgrade, and do-release-upgrade. Say what? Why are there three different paths to upgrading an operating system? Truth be told, each of those commands does different things. Confused?
Open source: Must-read coverage
How to Set Temporary Environment Variables in Linux (+Video Tutorial)
How to Create and Use a Docker Secret From a File (+Video)
CISA Aims For More Robust Open Source Software Security for Government and Critical Infrastructure
Best of Open Source Summit Europe 2023: The State of the Open Nation
Let’s first look at the difference between apt-get upgrade and apt-get dist-upgrade (as that is where much of the confusion lies). When you run apt-get upgrade, it only upgrades that which has a new release available to the platform, as defined in /etc/apt/sources.list or in /etc/apt/sources.list.d/.
However, when you run apt-get dist-upgrade, it will intelligently install or remove packages as needed, in order to complete the upgrade. Apt-get dist-upgrade has a smart conflict resolution system, so it will attempt to upgrade the most important packages, at the expense of those deemed less important.
Apt-get upgrade does not remove packages, it only upgrades. Can you use sudo apt-get dist-upgrade as your regular upgrade tool? Certainly. Just remember, it will delete software–if it is required to complete the process.
do-release-upgrade
The do-release-upgrade command, on the other hand, is responsible for upgrading from one release to another. So if you want to upgrade from Ubuntu 18.10 to 19.04, you use do-release-upgrade.
However, in order to use this command, the system must first be fully upgraded. To do that, you should first run
sudo apt-get upgrade
, followed by
sudo apt-get dist-upgrade
. When those two complete, you can then run
sudo do-release-upgrade
and wait for the magic to complete.
The difference between these commands is important. In fact, you might want to read up on the apt-get and do-release-upgrade man pages to find out more. To do that, issue the commands
man apt-get
and
man do-release-upgrade.
Enjoy the read.
Jack Wallen is an award-winning writer for TechRepublic, The New Stack, and Linux New Media. He's covered a variety of topics for over twenty years and is an avid promoter of open source. For more news about Jack Wallen, visit his website jackwallen.com.
See all of Jack's content
Check your email for a password reset link. If you didn't receive an email don't forgot to check your spam folder, otherwise
contact support
.
Thanks for signing up! Keep an eye out for a confirmation email from our team. To ensure any newsletters you subscribed to hit your inbox, make sure to add
[email protected]
to your contacts list.
Back to Home Page