Command Line

How To: Update Ubuntu From The Terminal

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 CTRL + ALT + T and your default terminal should pop open.

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:

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:

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:

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 ENTER to continue. That’s it, you’re done.

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:

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.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

1 day ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

3 days ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

5 days ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

1 week ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

1 week ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

2 weeks ago