Deleting ports distfiles

RW rwmaillists at
Mon Nov 17 13:13:03 UTC 2014

On Sun, 16 Nov 2014 14:10:00 -0900
Royce Williams wrote:

> On Sun, Nov 16, 2014 at 1:55 PM, andrew clarke <mail at>
> wrote:
> > On Sun 2014-11-16 23:29:37 UTC+0100, 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.
> >
> > Yes. Missing distfiles will be redownloaded when/if you rebuild a
> > port.
> You can also delete just the unused ones, if you're using portmaster
> or portupgrade ('portsclean' command).  See the bottom of the "Using
> the Ports Collection" docs page:
> Even if you don't use portmaster for anything else, using it for this
> purpose is worth the install, IMO.

portupgrade's portsclean utility and distviper (from
sysutils/bsdadminscripts) can do it more flexibly.

portmaster removes any files not associated with currently installed
packages, the other two do can do that, but also have the option to
leave any files that are still up-to-date with respect to the ports
tree. Most distfiles are replaced every few months, so it doesn't make
a huge difference in terms of disk space. 

More information about the freebsd-ports mailing list