≡ Menu

Reconfiguring FreeBSD Ports – Remove OPTIONS config For Any Port

While building Apache port I was presented with a menu from which I selected certain build options. However, certain option giving out error as follows:
===> apache-2.2.8 mod_mem_cache requires WITH_THREADS.
*** Error code 1

All I wanted to do is disable mod_mem_cache and build Apache again. Unfortunately, it is not allowing me to clear out configuration option. How do I remove all selected options and allow me to start over again?

There are many ways to clear out configuration options under FreeBSD. make command offers various options to revisit CONFIG menu to add, remove, or change options after a port has been built.

make rmconfig option

The simplest one is type command make rmconfig. First login as root; go into the directory containing the port and type:
# cd /usr/ports/www/apache22
# make rmconfig


===> Removing user-configured options for apache-2.2.8

Use ‘make config’ to modify settings

Another option is type make config.
# make config
# make install clean

To display OPTIONS config for port, enter:
# make showconfig
See the man page ports for more information:
$ man ports

Share this tutorial on:

Like this? Follow us on Twitter OR support us by using Patreon

{ 14 comments… add one }
  • BOK February 27, 2008, 1:55 pm

    Thanks! I still find it hard to find the right documentation on how to use these ports-commands on FreeBSD…
    Can’t remember I ever heard of “rmconfig”.

  • nixCraft February 27, 2008, 4:01 pm


    man ports has all info.

  • robot August 26, 2008, 5:48 pm


    This has solved my problem with apache giving me hell about openldap! Just took out that option and it compiled cleanly!


  • kingwah February 6, 2009, 8:39 am

    Big thanks to you!
    Really solving my problem!!

  • BoogieBoy March 6, 2009, 10:14 am

    Thank you for this tip. Helped alot ;)

  • mfccmf May 16, 2009, 3:46 am

    is there a way to do make rm config for the whole ports tree?

    • neubian August 28, 2012, 10:50 pm

      Installed port options are located in a file called “options” in the directory named /var/db/ports/”portname”.

      To remove an individual ports options remove that ports directory
      ex: # rm -rf /var/db/ports/apache22

      To remove all the ports options then remove all the sub-directories.

  • jjmoreno23 June 10, 2009, 1:23 pm

    thanks a lot for this tip, i have problems compiling gpg and this tip save me a lot of time

  • Nitromaroder June 10, 2009, 7:04 pm

    Thanks for the info – btw., you have a typo – it’s not ‘make ports’ but ‘man ports’.

    — regards,

  • nixCraft June 10, 2009, 8:26 pm

    Thanks for the heads-up!

  • Just wondered the same December 1, 2009, 3:29 pm

    find . -type d -iname ‘p5-*’ | while read d ; do pushd . ; cd $d ; make rmconfig ; popd ; done

  • Just wondered the same December 1, 2009, 3:30 pm

    To remove configuration from all subdirectories, beginning with ‘p5-‘

    find . -type d -iname ‘p5-*’ | while read d ; do pushd . ; cd $d ; make rmconfig ; popd ; done

  • Alan January 29, 2010, 11:19 am

    Thank you! This tip help-me a lot!


  • andl July 26, 2013, 8:20 am

    Many thanks for advise from n00b!

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">

   Tagged with: , , , , , , , , , , , , , , , , , , ,