Topgrade is a powerful tool that simplifies the update of all your system software with a single command. It updates the operating system, Snap packages, Flatpak, containers, Python libraries, and much more. Below is a clear and optimized guide to installing and configuring Topgrade on Debian/Ubuntu-based systems, ensuring an efficient and secure process.

https://github.com/r-darwish/topgrade
Prerequisites
Before starting, make sure you have administrator privileges and a stable internet connection. Additionally, you need to install Rust since Topgrade is written in this language.
Step 1: Install Rust
-
Update the system and install the necessary dependencies:
sudo apt update sudo apt install -y curl build-essential pkg-config libssl-dev -
Download and install Rust using the official script:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -
Add the Cargo directory to the PATH for the root user:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.profile source ~/.profile -
Verify the installation of Rust and Cargo:
rustc --version cargo --version
Step 2: Install Topgrade
-
Install Topgrade using Cargo:
sudo cargo install topgrade -
Install additional necessary dependencies:
sudo cargo install cargo-update
Step 3: Run Topgrade
To update the entire system, execute:
topgrade
Note: It is recommended to run Topgrade with root privileges to ensure that all system components are updated correctly.
Step 4: Configure Automatic Updates
To automate updates every 60 minutes, create a systemd service and timer.
-
Create the Topgrade service:
sudo nano /etc/systemd/system/topgrade.serviceAdd the following content:
[Unit] Description=Run Topgrade to update the system After=network-online.target [Service] Type=oneshot ExecStart=/root/.cargo/bin/topgrade -y [Install] WantedBy=multi-user.target -
Create the timer:
sudo nano /etc/systemd/system/topgrade.timerAdd the following content:
[Unit] Description=Timer to run Topgrade every 60 minutes [Timer] OnBootSec=10min OnUnitActiveSec=60min Persistent=true [Install] WantedBy=timers.target -
Enable and start the timer:
sudo systemctl daemon-reload sudo systemctl enable topgrade.service sudo systemctl enable topgrade.timer sudo systemctl start topgrade.timer
-
Security: Running Topgrade with root privileges is necessary to update all system components, but always review updates to avoid unwanted changes.
With Topgrade, keeping your system updated is easier than ever. Automate your updates and enjoy efficient software management!
