Linux Commands

How to Use Topgrade to Update Packages in Linux

Topgrade is a command-line utility that is useful for most Linux distributions like Debian, Arch Linux, Red Hat, etc. It keeps checking on all the installed tools and handles their updates. While upgrading it also detects errors and monitors them.

Topgrade is a multi-purpose tool that allows the user to perform multiple operations. It also displays an overview before the package is updated and gives you authority to control it.

Install Topgrade on Linux

We can install Topgrade on Linux system using Rust’s Cargo package manager. So, we need to get it first using the mentioned command:

$ sudo apt update && sudo apt upgrade

Install Cargo package manager:

$ sudo apt install cargo libssl-dev pkg-config

Run the command to install Topgrade tool through Cargo on Linux system:

$ cargo install topgrade

You might get an error like this at the end of installation:

Set a path by making use of mentioned command by replacing your username instead of mine (wardah):

$ echoexport PATH=$PATH:/home/wardah/.cargo/bin’ >> /home/wardah/bashrc

Reboot your Linux system to let the functions perform perfectly.

Use Topgrade to Update Packages in Linux

To upgrade the complete Linux system, run the Topgrade command in the terminal:

$ topgrade

At the end of installation, you will get the following response:

Clean Temporary Files with Topgrade

Topgrade is a multi-purpose command useful for updating purposes but also helps you to clean your system by removing temporary files. This would help to free up system space and reduces bug risk.

Run the following command to clean up old files in Linux system:

$ topgrade --cleanup

Update Particular Package with Topgrade

With the Topgrade command, users can also update the specific packages instead of all. For this purpose, the “–only” option will be used with the application name:

$ topgrade --only <package_name>

For example:

$ topgrade --only vim

Exclude Package from Being Updated with Topgrade

Topgrade is also helpful in excluding packages from being upgraded. Let’s suppose to exclude snap, the command would be:

$ topgrade --disable snap system


Topgrade is a command line utility that handles system updates on most Linux distributions including Debian, Red Hat, and Arch Linux. You can install this tool on Linux system through Cargo package manager. After the installation, you can use this tool to update a single package or all packages on your system. You can also utilize this tool to remove unnecessary temporary files to free up the disk space on Linux system.

About the author

Syeda Wardah Batool

I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.