J
J
John Smith2021-03-05 00:07:42
linux
John Smith, 2021-03-05 00:07:42

How to make a script in Linux that will install the programs I need?

The situation is as follows: there is linux mint 19.3 Tricia, with 2GB of RAM. The other day I decided to buy another 2GB plank, so that there would be a 64-bit architecture! Accordingly, there was a question of reinstalling the OS. And the question is this: there are a number of programs I need that are stored in repositories, and I am extremely lazy to install them all from the store or write the installation command manually, so I ask you for help to tell me how to make a script that will install everything for me my favorite programs! That is, one file, which will contain a list of the packages I need! Thank you for your attention!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
ge, 2021-03-05
@th3PythonG3nteleman

You can make it a little more convenient - keep the list of packages in a separate file (you can also comment on the lines), but the script will become a little more complicated:
install.sh :

#!/usr/bin/env bash
PKG_LIST=packages.txt
sed '/#/d' "$PKG_LIST" | xargs apt install -y

packages.txt:
# Python
python3-dev
python3-venv
python3-pip
python3-setuptools

# Perl
perl
libwww-perl
libxml-rss-perl

F
Filipp42, 2021-03-05
@Filipp42

And why not list all the packages you need, after that copy them one by one, throw them on a flash drive, reinstall the OS, enter sudo apt install and copy the contents of the file from the flash drive with the list of packages to the command line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question