I'm playing with a FreeBSD installation inside a Virtualbox vm, and I want to keep the size of the image relatively small. How can I configure FreeBSD to clean distfiles after installing a port (using make
, portupgrade
, etc)?
I'm playing with a FreeBSD installation inside a Virtualbox vm, and I want to keep the size of the image relatively small. How can I configure FreeBSD to clean distfiles after installing a port (using make
, portupgrade
, etc)?
Sequentially:
If "after installing a port", just use the distclean target:
This will clean the work directory and the distfile after installing.
If you want to clean distfiles separately from installation, just run
If you're using portupgrade, you can use portsclean.
...will clean out the working directories of the ports tree and clean out the distfiles of any port that is not installed.
There's more than one way to do it:
DISTDIR
inmake.conf
to/tmp/distfiles
, or symlink/usr/ports/distfiles
to/tmp/distfiles
./tmp
will be cleared on the next reboot.@reboot root rm -rf /usr/ports/distfiles/*