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?
3 Answers
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 - 15I prefer
make config-recursive && make install clean, as it gives you all config-dialogs upfront while the actual installation will likely work unattended.user569825– user5698252012-09-16 11:56:00 +00:00Commented Sep 16, 2012 at 11:56 - Also, to shorten your workload required for configuration, it's often a reasonable idea to exclusively look at the options that are active by default and just consider deactivating any of those.user569825– user5698252012-09-16 12:01:00 +00:00Commented Sep 16, 2012 at 12:01
- 9Also please run
make config-recursivemultiple times until you stop getting new options (i.e. at least twice). Any time you change an option, it may bring in another dependency that has yet more options.Alex Hirzel– Alex Hirzel2013-03-06 15:22:43 +00:00Commented Mar 6, 2013 at 15:22 -
exportwill only work onshwhich is not the FreeBSD default shellajeh– ajeh2017-08-02 18:10:02 +00:00Commented Aug 2, 2017 at 18:10
I think it's worth mentioning that you might not always want to do this. I seem to remember, for instance, needing to config emacs to add xft support. If you want to bypass the prompts for a single build,
make install clean BATCH=yes will work as well.
- somehow works better than putting "BATCH=yes" in the front of make. Thanks.hari– hari2012-01-18 00:28:08 +00:00Commented Jan 18, 2012 at 0:28
- Worth noting that
make install clean BATCH=has the same effect, as according to the manual forports(7), it must only be defined. It can be set to anything or nothing at allHarold Fischer– Harold Fischer2018-06-26 15:28:54 +00:00Commented Jun 26, 2018 at 15:28
This doesn't automatically accept defaults like you're asking, but I like the "make config-recursive" method which runs you through any options for the port you want as well as options for all dependencies. You don't have to change anything if you don't want to, but you go through all selection screens at once rather than whenever the building process arrives at them.
Once that's done, your "make install clean" should go pretty much unattended.
- 5As I said on @Yasir's post--make sure to run this multiple times. If you change an option which brings in another dependency, if that dependency has options to configure you won't touch it until the next run of
make config-recursive.Alex Hirzel– Alex Hirzel2013-03-06 15:23:36 +00:00Commented Mar 6, 2013 at 15:23 - Personally think this should be the accepted answer.revprez– revprez2016-12-24 23:59:13 +00:00Commented Dec 24, 2016 at 23:59