Operations 6 min read

Automate Reinstalling Your Favorite Linux Apps with a Simple Bash Script

Learn how to create a concise Bash script that automatically reinstalls your preferred desktop Linux applications using apt and snap, saving hours of manual setup when switching or refreshing your system.

ITPUB
ITPUB
ITPUB
Automate Reinstalling Your Favorite Linux Apps with a Simple Bash Script

When you frequently reinstall a Linux desktop, repeatedly installing the same set of applications can be time‑consuming. This guide shows how to write a short Bash script that automates the installation of favorite tools such as Audacity, Kdenlive, Spotify, Discord, Telegram, Steam, and OBS Studio.

What is a Bash script?

A Bash script is a plain‑text file containing a series of commands that the shell can execute sequentially, enabling automation of repetitive tasks.

Creating the script

Open your preferred text editor (e.g., gedit) and start the file with the shebang line: #!/bin/bash Add a comment describing the script’s purpose:

# Install my favorite desktop applications

Adding installation commands

Use sudo apt for Debian/Ubuntu packages and snap for Snap packages. The double ampersand ( &&) ensures each command runs only if the previous one succeeds, and it stops the script on error.

sudo apt update && sudo apt install -y audacity kdenlive spotify-client discord telegram steam obs-studio
sudo apt install -y snapd
# Example snap installation
sudo snap install vlc

Making the script executable

Save the file (e.g., install_apps.sh) and set the executable flag: chmod +x install_apps.sh Alternatively, right‑click the file, open Properties, go to the Permissions tab, and enable “Allow executing file as program”.

Running the script

Open a terminal, navigate to the script’s directory, and execute: ./install_apps.sh You will be prompted for your password; the script will then install all listed applications and keep them up‑to‑date with future system updates.

Important notes

Some distributions may not allow automatic execution from the file manager; you may need to run the script manually from a terminal.

If snapd is already installed (common on Ubuntu), the sudo apt install snapd line can be omitted.

The script can be extended with additional commands or customized to match your personal workflow.

This basic approach can be expanded into more sophisticated automation scripts that save minutes or even hours of manual input.

APTscriptSnap
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.