5

I would like to create a script to install everything on my raspberry pi (after reinstallation or on another pi, but this is linux question in general). I write down the commands one by one into my script, but when I install samba sudo apt-get install samba -y the following question opens and awaits an answer:

Samba server and utilities

If your computer gets IP address information from a DHCP server on the network,
the DHCP server may also provide information about WINS servers
("NetBIOS name servers") present on the network.
This requires a change to your smb.conf file so that DHCP-provided WINS settings
will automatically be read from /var/lib/samba/dhcp.conf.

The dhcp-client package must be installed to take advantage of this feature.
Modify smb.conf to use WINS settings from DHCP?

<Yes>   <No>

How can I skip this question? I would like the installation to proceed automatically, but this question is waiting for an user input. Is there any other parameter to avoid this question or set answer before run installation?

  • What's your preferred answer to the Yes/No it's asking? – roaima Oct 12 '19 at 12:18
  • Since my raspberry has a dynamic IP, I would like to answer yes. But after another half hour of searching, I found the answer in another thread: serverfault.com/questions/407317/… Right now I tried it and it looks functional with the command debconf-set-selections – Atiris Oct 12 '19 at 12:32
  • 2
    Excellent. Please put your answer into an answer rather than in the question. You can then accept your own answer (tomorrow) – roaima Oct 12 '19 at 12:52
6

I found the answer (for apt-get not in general for samba install) in this thread to apt-get.

The debconf-set-selections command helped me set answer before installation start.
If you want to answer "yes", you can use the following commands:

echo "samba-common samba-common/workgroup string  WORKGROUP" | sudo debconf-set-selections
echo "samba-common samba-common/dhcp boolean true" | sudo debconf-set-selections
echo "samba-common samba-common/do_debconf boolean true" | sudo debconf-set-selections
sudo apt-get install samba -y
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.