lilzz
Posts: 411
Joined: Sat Nov 30, 2013 5:27 pm

Automate the apt-get installs

Tue Oct 14, 2014 11:45 am

I have whole bunch of
apt-get install A
apt-get install B
apt-get install C

.....


Is there way to automate this? many of them have prompt user [Y/N].
Can I force them all Yes. Write a script automatically do many apt-get installs?

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Automate the apt-get installs

Tue Oct 14, 2014 11:47 am

sudo apt-get install package-a package-b package-c -y
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Automate the apt-get installs

Tue Oct 14, 2014 11:49 am

You may be able to use unattended upgrades.

http://serverfault.com/questions/22324/ ... nny-stable
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

plugwash
Forum Moderator
Forum Moderator
Posts: 3614
Joined: Wed Dec 28, 2011 11:45 pm

Re: Automate the apt-get installs

Tue Oct 14, 2014 3:24 pm

You can install multiple packages on one line.

Apt has various options to reduce/eliminate interactivity, of course using them comes at some risk

--trivial-only
This will make the command only succeed if it would have run without a prompt, otherwise it fails.

--assume-yes (or -y)
this will make the command assume yes to most prompts but it will abort on some of the scarier ones (it still carries a risk of damage though)

--force-yes
should be pretty self explanatory.

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Automate the apt-get installs

Tue Oct 14, 2014 3:58 pm

Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

Return to “General discussion”