I want to use netcat-traditional in Ubuntu but configure this in a Dockerfile, so obviously I cannot use the helpful command prompt triggered when running sudo update-alternatives --config nc

How do I select the correct option automatically without being prompted?

These instructions explain what I want to do but assume access to a command prompt.

up vote 2 down vote accepted

To set the default netcat without being prompted at the command line, type:

sudo update-alternatives --set nc /bin/nc.traditional

From the manpage:

--set name path

Set the program path as alternative for name. This is equivalent to --config but is non-interactive and thus scriptable.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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