shellubuntudebianiptables

Prevent prompt when `apt install -y iptables persistent` on Debian/Ubuntu


I'm making a script of auto-starting server.

when I exec following command, I get blue screen prompt. What the name of the scereen?

apt install -y iptables-persistent

The goal what I wanna do is one of following

Of course, 2-times manual ENTER solve this problem, but I want to automate this step.

what I tried:

[ENVIRONMENT]


Solution

  • Use this command to fully automate the installation

    echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
    echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
    sudo apt-get -y install iptables-persistent