I
I
Ivan Ivanov2017-02-20 14:30:56
bash
Ivan Ivanov, 2017-02-20 14:30:56

How to automate the installation of programs on bash?

I want to write a script that will install certain programs on vps, for example:

apt-get update
apt-get install build-essential chrpath libssl-dev libxft-dev
apt-get install libfreetype6 libfreetype6-dev
apt-get install libfontconfig1 libfontconfig1-dev
и т. д.

As far as I understand, the commands are executed sequentially, but at some point during the installation, the question is displayed:
Do you want to continue? [Y/n]
And then the commands do not work out.
How can I make the script automatically answer Y and continue installing programs? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xibir, 2017-02-20
@romalu

apt-get has a -y option
Automatic 'yes' to all questions.

V
vanoc, 2017-02-21
@Zoro

It is not necessary to write several apt-get installs, just one is enough, although if you feel more comfortable....

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question