Central system updates with Topgrade
In One Fell Swoop
Topgrade detects all the package managers installed on a system and executes them one by one at the command line.
The times when the preferred source for an application was a distribution's own archives are definitely over for the majority of users today. In addition to third-party repositories, Flatpaks, AppImages, and snaps, the average user's filesystem also hosts PIP (Python), Cargo (Rust), npm (Node.js), or Homebrew (macOS) based installations. All of these installations bypass the operating system's update mechanisms, forcing you to update them separately.
One way out of this uncomfortable situation is the Topgrade package manager. Topgrade was recently abandoned by the original developer after five years [1], but the community is now continuing to maintain the tool as Topgrade-rs [2]. For simplicity's sake, I will simply refer to the community fork of the tool as Topgrade in this article.
One for All
Topgrade promises to launch all package managers used on the system one by one via a single terminal command, as well as install updates available for them, even on remote machines. This offer does not just apply to Linux, but also to the Windows Subsystem for Linux (WSL), Chocolatey and Scoop on Windows, and FreeBSD and DragonFly BSD. Topgrade relies on the fwupd daemon to integrate firmware from the Linux Vendor Firmware Service (LFVS) [3]. In addition, the tool updates far more software, such as Pi-hole, tmux, and Vim plugins. An overview is available on GitHub [4].
You can pick Topgrade up from the AUR for Arch Linux (as well as Manjaro and other Arch offshoots). NixOS and Void Linux also offer the tool. The project's GitHub instance offers the source code and binary packages for the x86_64, AArch64, and ARMv7 architectures, as well as for Apple Darwin and Windows.
Topgrade requires at least version 1.6.2 of Rust, which is already included in many distributions. You can check the version number by typing rustc --version
. For Debian, you need at least Debian Testing to deploy version 1.6.3. On Ubuntu, a 22.04 release will do nicely; Fedora 37 also comes with the right version in place. If the command fails to find rustc
on your system, you need to install the package using your distribution's package manager and then check the version again.
Cargo Installer
The easiest way to install Topgrade – ironically bypassing the respective native package system – is with the Cargo Rust package manager. On most systems, you will first need to install Cargo and resolve some dependencies via the package manager (Listing 1, line 2 or 4) and then update (line 6).
Listing 1
Installation
01 ### Set up Cargo on Debian 02 $ sudo apt install cargo pkg-config libssl-dev 03 ### Set up Cargo on Fedora 04 $ sudo dnf install cargo pkg-config openssl-devel 05 ### Cargo update 06 $ cargo install cargo-update 07 ### Set up Topgrade 08 $ cargo install topgrade
The next step is to set up Topgrade (line 8). The last step of the build process can take a few minutes. Then add the following line to the search path at the end of your ~/.profile
file (Figure 1):
export PATH=$PATH:$HOME/.cargo/bin
Topgrade's configuration file, ~/.config/topgrade.toml
, supports both general and specific settings for individual package managers. This is also where you specify the hostnames of the remote computers you want to update via SSH. The prerequisite for this is that Topgrade is already installed on the remote computer.
Then, as soon as you run the topgrade
command, the application executes the upgrade commands in all of the package managers discovered on your system. It starts with the distribution's native package manager, followed by Flatpak and Snap and the other candidates (Figure 2).
Conclusions
Topgrade is not witchcraft. It simply provides the logic to detect and execute all existing package managers one by one. Topgrade is not suitable for people who want to exclusively use the distribution's package manager. However, if you do use Flatpaks or snaps and run a Raspberry Pi or a server with Pi-hole or other services, then Topgrade will handle much of the administration work for you.
In testing, a system update with Topgrade worked without any problems on Debian, Ubuntu, and Fedora (Figure 3). Distrobox was the only software that failed to update. Unable to figure out the reason, I filed a bug report.
Infos
- Topgrade: https://github.com/r-darwish/topgrade
- Topgrade-rs: https://github.com/topgrade-rs/topgrade
- LVFS: https://fwupd.org
- Supported package managers: https://github.com/r-darwish/topgrade/wiki/Step-list
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.