FreeBSD – How to Avoid Prompts When Installing a FreeBSD Port

bsd-portsfreebsd

When I install a port, I am often presented with a menu screen to select configuration options. If I'm going to install a really big package with lots of dependencies, that will be extremely inconvenient. Is there a make flag for accepting the default answers for all such prompts?

Best Answer

Probably BATCH, described in ports(7), is what you're looking for:

# cd /usr/ports/sysutils/screen
# export BATCH=yes
# make rmconfig
# make install clean
(no configuration menu is displayed)

make rmconfig removes OPTIONS config for this port, and you can use it to remove OPTIONS which were previously saved when you configured and installed screen(1) the first time. OPTIONS are stored to directory which is specifed via PORT_DB_DIR (defaults to /var/db/ports).

If you use bash, BATCH can be set automatically every time you log in:

# echo 'export BATCH=yes' >> ~/.bash_profile
Related Question