Keeping a Linux system updated often requires running separate commands for different package managers and security software. Modern Ubuntu setups routinely use APT for system core packages, Snap for containerized applications, Flatpak for additional desktop apps, and ClamAV for virus protection.
Instead of typing individual commands or executing separate maintenance scripts, you can combine every update task—including stopping the ClamAV daemon, updating the virus database, restarting the service, and fetching all system updates—into a single one-word terminal alias.
The Master Command Explained
Here is the complete command chain packed into the alias:
Command Breakdown:
sudo apt update && sudo apt full-upgrade -y: Refreshes APT software repositories and performs a complete system package upgrade with automatic confirmation.
sudo snap refresh: Checks for and applies background updates for all installed Snap applications.
flatpak update -y: Updates all Flatpak applications and runtime dependencies without manual prompts.
sudo systemctl stop clamav-freshclam: Temporarily stops the automatic ClamAV background updater to prevent file-lock errors (freshclam.log) during manual updates.
sudo freshclam: Manually fetches and downloads the absolute latest virus definition signatures.
sudo systemctl start clamav-freshclam: Restarts the background ClamAV updater daemon to resume automated monitoring.
echo "Everything is now completely updated!": Displays a custom confirmation message in the terminal once all update tasks finish successfully.
Open your .bashrc file in Nano: Open the terminal (Ctrl + Alt + T) and run:
Whenever you want to perform a full system maintenance and antivirus signature sweep, simply open your terminal and type:
Enter your administrator password when prompted. The terminal will automatically walk through APT, Snap, Flatpak, and ClamAV updates, concluding with the status message: "Everything is now completely updated!"
If you prefer using a graphical editor instead of the terminal editor, you can access and edit your .bashrc file directly from your Home folder:
It updates all system packages managed by APT, Snap applications, Flatpak packages, and the ClamAV virus database. However, software installed manually via standalone AppImages or direct script downloads will still need to be updated separately.
The automatic ClamAV background updater (clamav-freshclam) locks the virus definition database file (freshclam.log). Stopping the daemon temporarily prevents file-lock conflicts while running freshclam manually, ensuring the database updates smoothly before restarting the service.
Yes. You can replace update in alias update='...' with any short word or acronym you prefer, such as updateall, up, or sysupdate. Just make sure your chosen shortcut does not conflict with an existing Linux terminal command.
Because the command chain uses the && operator, each subsequent update task will only execute if the previous command completes successfully. If an APT or Flatpak repository fails to connect, the process stops at that step so you can review the error.