Is It Possible to Make Scripts to Automatically Install Programs?

I have some programs that I like in Ubuntu and some that I don't like. Is it possible to make a script to my memory stick such that it removes those programs I don't need and installs those I do need? For example, remove Gnome and Gedit, install Xfce, Kate, Texlive-base, and Okular.

1 Answer

You can write a script in a text editor, adding the sequence of apt-get commands you want to execute:

apt-get update && apt-get upgrade -y
apt-get dist-upgrade
apt-get remove --purge gnome gedit ...
apt-get autoremove -y
apt-get install xfce4 kate texlive-base ...

Then save the file. Now you can run it in a terminal (assuming you've saved it in your home directory):

[username@localhost ~] $ sudo sh my-script.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest