It’s possible, even easy, to update Ubuntu from the terminal. Personally, I almost always update from the terminal, regardless of distro. This article will tell you how to update Ubuntu from the terminal – but it’s equally valid for Debian, official Ubuntu flavors like Lubuntu or Kubuntu, and it’s also valid for distros based on Ubuntu or Debian – such as Mint.
I recently did an article about updating Fedora from the terminal. Boy howdy, I hope that link works! It’s scheduled for publication so it doesn’t show me the real URL that it’ll have when it has been published! So, I hope I typed it properly! Either way, I recently did said article and figured I might as well do one for Ubuntu.
The tool we’ll be using is known as ‘APT‘ and apt has been a staple of Linux since Debian introduced it in the late nineties. It’s known as “Advanced Package Tool” and is used to configure and install applications. Even if you’re doing it graphically, it’s usually apt under the hood when you’re using Debian, Ubuntu, Mint, etc…
There really isn’t a whole lot to this, so it should be a reasonably short article. It’s also an article that may make the terminal more approachable for people who are new to Linux. Once you see how easy it is, you might decide to try it yourself! If it goes well, you might learn more about the terminal and the many ways you can use it. We can find out!
Update Ubuntu From The Terminal:
This article requires an open terminal, like oh so many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press
Once you have your terminal open, you’re going to update your database of available software and the version numbers of said software. This database will be checked against the database of software (and versions) that you have already installed. It’s just a simple command:
1 | sudo apt update |
That’ll let you know if there’s any software that needs to be updated and may take a few seconds to complete. If any software is available it will let you know and you can upgrade to the newest version. The notification will look something like:
1 | 3 packages can be upgraded. Run 'apt list --upgradable' to see them. |
You can, as stated, see which applications need to be upgraded to new versions by running that command. This upgrade process may also add or remove system software as needed. But, to upgrade, it’s just as easy:
1 | sudo apt upgrade |
This will spit out a list of software that will be updated, will be added, or should be removed – and you can enter “Y” to agree to the upgrades before pressing
However, I like to alias (an article still not written should link here) all this to a single command. My actual command looks like this:
1 | sudo apt update && sudo apt upgrade -y && sudo apt autoremove |
That will update the database and make sure it completes successfully. It will then upgrade the software, effectively entering the Y for you. Finally, it will automatically remove software that’s no longer needed. Some folks might consider that command a bit risky to run automatically, but I’ve been doing it for years. Use it at your own risk!
Closure:
That’s it, actually. There’s really not that much more I can tell you about how to update Ubuntu from the terminal. Sure, there are other apt commands, but those aren’t really important for this article. Unlike the Fedora article, there’s no handy way to undo an upgrade with apt.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.