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.


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 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.