How to Keep Your Linux System Up to Date With Topgrade

Updating a Linux machine is a painstakingly tedious task. One that involves running a bunch of commands to get everything from system elements to third-party packages and tools running on the latest version.

Sign up forfree

Forgot your password?

Create an account

*Required: 8 chars, 1 capital letter, 1 number

By continuing, you agree to thePrivacy PolicyandTerms of Use.You also agree to receive our newsletters, it’s possible to opt-out any time.

4

Follow along as we check out Topgrade in detail and show you how you can use it to keep your Linux system up to date.

What Is Topgrade?

Topgrade is a CLI utility that lets youupdate your Linux systemwithout having to actually go through the update process, which typically involves running a bunch of commands. The way this works is that when you invoke Topgrade inside the terminal, it identifies all the tools installed on your system and runs appropriate commands on your behalf to update them.

What Can Topgrade Update?

Topgrade works on most Linux distros: Debian, Red Hat, Arch Linux, openSUSE, Gentoo, Clear Linux, and Void Linux. Additionally, it also supports third-party package managers like Snap and Flatpak.

So, if you’re running any of these distros on your system or have any of the supported third-party package managers installed, Topgrade will handle their updates for you. Similarly, when you run Topgrade, it can also identify and update tmux, Flutter SDK, pip, Vim/Neovim, Node, and Pi-hole, among several other package managers.

a woman using a laptop

How to Install Topgrade on Linux

you could install Topgrade using Rust’s Cargo package manager. But first, you need to install Cargo (and some of its dependencies) on your system. If you already have it installed, you can skip this step and proceed to install Topgrade.

To install Cargo on Linux, open the terminal and run the following command:

article limit background

Next, once Cargo is installed, you can install Topgrade with this command:

As soon as the installation is complete, you’ll see a warning message on the screen telling you to add the path for Topgrade to your $PATH variable so you can use it from anywhere on the system.

topgrade warning message to set path variable

Check out ourguide on setting the $PATH variable on Linuxto find out how to do this correctly. Alternatively, if you just want to use Topgrade once, you can add it to the $PATH variable like this:

How to Use Topgrade to Update Everything on Linux

As mentioned earlier, Topgrade works pretty much on its own. As soon as you invoke it, it automatically identifies and updates packages installed on your computer.

Hence, using Topgrade is incredibly easy. You just need to run a simple command and respond to confirmation prompts as they pop up in the terminal. Additionally, with some packages and utilities, you’ll also need to enter your system password to authenticate the operation.

running topgrade inside a terminal

To update your system with Topgrade, open the terminal and run this command:

When prompted to confirm an update, hitYfor yes andNfor no. Topgrade will now run a series of commands. Sit back and let it finish updating the packages.

If you’d like to quit, hitCtrl + Cand enterq.

Exclude Packages From Being Updated

Since the topgrade command essentially updates the entire system, it takes a while for the process to complete. To help you get around this, Topgrade lets you exclude specific packages from being updated, so you may prevent Topgrade from updating them with the rest of the packages.

For instance, say you don’t want Topgrade to update the vim package on your system. To do this, you can simply use the–disableflag and run the command like this:

View What Packages Will Be Updated on Your System

Before you invoke Topgrade, you can view a summary of all the packages on your machine that will be updated in the process.

For this, open the terminal and run:

Clean Temporary or Old Files

One of the things you can do with Topgrade—aside from updating your Linux system—is clean up the temporary or old files you have on your machine. Not only does this free up storage space, but it also reduces the risk of your system or its programs running into errors or bugs.

To clean temporary or old files using Topgrade, run:

When prompted for a password, type in your admin password and hitEnter. You may also be asked to confirm certain file deletion operations. PressYand hitEnterto proceed.

Get Detailed Information About an Operation

Like many CLI-based programs, Topgrade also gives you the–verboseoption to view detailed information about the running process. If you’re interested in viewing how Topgrade updates the packages, you can do so by running this command:

Update a Particular Package

Occasionally, you may want to update only specified packages. In such situations, you can use the–onlyoption to update a particular package. Here’s what the command looks like:

For example:

Edit the Topgrade Configuration File

Much like other Linux programs, Topgrade also has a configuration file that tells the program how to function, what operations to perform, and so on.

While Topgrade offers certain options that let you do this explicitly from the terminal, you’re able to also modify its configuration file to make those changes permanent. That way, you don’t have to do this yourself every time you run the command.

To edit the Topgrade configuration file, run this in a terminal window:

When this opens the configuration file, you can modify (change, add, remove) values associated with different actions. To enable an action, un-comment the line by removing thePoundsign (#).

Similarly, the file also contains custom commands and pre-commands. If you want Topgrade to run a custom command when it runs, you can add that command to theCustom Commandssection.

On the other hand, if there’s any command that you want the program to run before anything else, enter it under theCommands to run before anythingsection. When you’ve finished making changes to the configuration file, save and close it.

Simplify the Boring Linux System Update Process

Topgrade is one of those tools you wish you had known about sooner. It’s easy to use and offers the simplest way to automate Linux system updates to save yourself the time and effort of going through the process manually.

One of the best times to use Topgrade is when you’re not actively using your computer, as you can run the program and leave it while it updates the system.

That said, though, Topgrade has some limitations that limit it from being used with scripts or even with some advanced operations involving custom commands. For most users, though, Topgrade can be extremely useful.

If certain packages are causing issues on your system and updating them still doesn’t fix the problem, they’re likely broken, so you may need to step in and fix them manually.

Broken packages need repairing or the software won’t run. Here’s how to find the broken packages and fix them in Linux.

Not Linux, not Windows. Something better.

It’s not super flashy, but it can help to keep your computer up and running.

Your iPhone forgets what you copy, but this shortcut makes it remember everything.

These are the best free movies I found on Tubi, but there are heaps more for you to search through.

You can block out the constant surveillance and restore your privacy with a few quick changes.

Technology Explained

PC & Mobile