Deleting ports distfiles

Adam Vande More amvandemore at
Sun Nov 16 23:20:11 UTC 2014

On Sun, Nov 16, 2014 at 4:29 PM, Dr. Peter Voigt <pvoigt at> wrote:

> I have just seen that /usr/ports/distfiles has grown up to 12 GiB. My
> hopefully not too stupid question is: Can I safely delete all files
> under /usr/ports/distfiles, e.g.
> # rm -rf /usr/ports/distfiles/*
> I strongly suppose so but I am not sure. Thanks for any feedback.

It is not necessarily a safe operation to preform depending on the
details.  The downloads in that location may be the last known copy of that
particular port/version at least as a copy available to you.  Deleting
those files could prevent you from rebuilding a certain port/version if
needed.  Nearly all the time this isn't a problem or easily worked around,
but not universally so IME.

After doing a ports upgrade, and ensuring fully correct operation of the
system it's generally safe to run something like "portmaster
-t--clean-distfiles" to remove stale distfiles.


More information about the freebsd-ports mailing list