I am writing a shell script to install all my required applications on my Ubuntu PC in one shot (while I can take a stroll or do something else). For most applications adding -y
to the end of the apt-get install
statement, has worked well to avoid the need for any user involvement. My script looks something like this:
#!/bin/bash
add-apt-repository ppa:webupd8team/sublime-text-3 -y
apt-get update -y
apt-get upgrade -y
apt-get install synaptic -y
apt-get install wireshark -y
Though I no longer have to worry about Do you want to continue? [Y/n]
or Press [ENTER] to continue or ctrl-c to cancel adding it
, the problem is with wireshark
, which requires a response to an interactive prompt as shown below:
How can I avoid this mandatory intervention?
DEBIAN_FRONTEND=noninteractive apt-get -y install [packagename]
– Wildcard May 29 '17 at 22:08fruit=apple echo $fruit
doesn't echo "apple", it echo's""
(empty) do you know why? – the_velour_fog May 29 '17 at 22:16fruit=apple; bash -c 'echo $fruit'
withfruit=apple bash -c 'echo $fruit'
withfruit=apple; echo $fruit
withfruit=apple echo $fruit
. – Wildcard May 30 '17 at 01:17DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install wireshark -y
should do the trick for me? – skrowten_hermit Jun 01 '17 at 06:00