Cleaning Ports Tree

Tim Daneliuk tundra at
Thu Apr 15 22:03:29 UTC 2021

On 4/15/21 4:05 PM, Dewayne Geraghty wrote:
> On 16/04/2021 6:37 am, Tim Daneliuk via freebsd-questions wrote:
>> I am aware that one can do this to clean the ports tree:
>>   cd /usr/ports
>>   make clean
>> However, this is very slow.  Is there any reason not to do this instead:
>>   find  /usr/ports -type d -name work -exec -vrf {} \;
>> This second approach is much, much (much) faster, I just want to make
>> sure I am not creating nasty side-effects thereby.

> I've done a similar thing since 2003 without ill effects.  For
> completeness I also have (in make.conf):
> WRKDIRPREFIX=/var/ports # when I perform a rebuild, I simply delete the
> subdirs
> DISTDIR=/distfiles # so all the distfiles are in one place
> PACKAGES=/packages # same for the outputs.
> It also allows the use of multiple devices.

This is actually even cleaner.  A simple rm -rf /var/ports cleanses the system ...

More information about the freebsd-questions mailing list