8

When I tried to install Wireshark automatically with : sudo apt-get install -y wireshark Ubuntu gave me that image:

enter image description here

How can I install wireshark from terminal without press "YES" ?why does -y didn't skip on that screen?

1 Answers1

6

Here you go!

First, configure the debconf database:

echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections

Then, install Wireshark:

sudo DEBIAN_FRONTEND=noninteractive apt-get -y install wireshark

You might also want to suppress the output of apt-get. In that case:

sudo DEBIAN_FRONTEND=noninteractive apt-get -y install wireshark > /dev/null
ldias
  • 2,135
  • 1
    This is the right answer if you're installing in a Docker container. In my case, the tshark package has a dependency in wireshark – phil-lavin Mar 10 '22 at 12:40
  • 1
    It's irrelevant 'why'. The question was 'how'! And some of us are facing situations where neither screen nor keyboard is accessible when installing stuff - on daily basis. Thanks for the answer! – tishma Jun 29 '22 at 13:24