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.

But thankfully, similar to most things on Linux, there's a tool to facilitate this process too. It's called Topgrade, and it lets you update your entire system using a single command.

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 you update your Linux system without 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.

How to Install Topgrade on Linux

You can 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:

        sudo apt install cargo libssl-dev pkg-config
    

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

        cargo install topgrade
    

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 our guide on setting the $PATH variable on Linux to 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:

        export PATH=$PATH:/home/username/.cargo/bin
    

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.

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

        topgrade
    
running topgrade inside a terminal

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

If you'd like to quit, hit Ctrl + C and enter q.

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 can 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 --disable flag and run the command like this:

        topgrade --disable vim
    

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:

        topgrade --dry-run
    
topgrade dry 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:

        topgrade --cleanup
    
topgrade cleanup command

When prompted for a password, type in your admin password and hit Enter. You may also be asked to confirm certain file deletion operations. Press Y and hit Enter to proceed.

Get Detailed Information About an Operation

Like many CLI-based programs, Topgrade also gives you the --verbose option 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:

        topgrade --verbose
    

Update a Particular Package

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

        topgrade --only package
    

For example:

        topgrade --only vim
    

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 can 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:

        topgrade --edit-config
    
editing topgrade configuration file

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 the Pound sign (#).

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 the Custom Commands section.

On the other hand, if there's any command that you want the program to run before anything else, enter it under the Commands to run before anything section. 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.