# Distfiles



## xy16644 (Dec 10, 2009)

Is it safe to delete ALL the files in the following directory:

```
/usr/ports/distfiles
```


----------



## graudeejs (Dec 10, 2009)

Yes.

Search forum for more info, there was same thread few days ago


----------



## xy16644 (Dec 10, 2009)

Thank you, that freed up a nice chunk of space! I assume its safe to delete everything in /tmp too...


----------



## SirDice (Dec 10, 2009)

Yes, it's safe. When you start building ports everything that's needed will be downloaded again.

If you have ports-mgmt/portupgrade installed you can also clean it with [cmd=]portsclean -D[/cmd]. This will remove all distfiles for things that aren't in the ports tree. Usually outdated stuff, quite handy if you regularly rebuild things. There's also `portsclean -DD` which will remove everything that isn't currently installed.

If you have ports-mgmt/portmaster then you can use [cmd=]portsclean --clean-distfiles[/cmd] or [cmd=]portsclean --clean-distfiles-all[/cmd]. Both will remove the distfiles of ports that aren't installed. The latter does it without prompting.


----------



## SirDice (Dec 10, 2009)

xy16644 said:
			
		

> Thank you, that freed up a nice chunk of space! I assume its safe to delete everything in /tmp too...


Careful with that. Some things are in use when the system is booted. If you want to clean it out automatically during boot just add to /etc/rc.conf:

```
clear_tmp_enable="YES"
```

The default setting should be fine though. It clears everything and recreates the directories needed for Xorg.

On Solaris /tmp actually occupies the same diskspace as swap. If some brainiac linux user writes a truck load of temporary data in /tmp (strangly enough they're used to doing that) you run out of virtual memory :x


----------



## xy16644 (Dec 10, 2009)

Thanks! I have added that to my /etc/rc.conf. Does it clear everything out when I reboot?


----------



## SirDice (Dec 10, 2009)

xy16644 said:
			
		

> Thanks! I have added that to my /etc/rc.conf. Does it clear everything out when I reboot?


It should, yes :e


----------



## graudeejs (Dec 10, 2009)

try and see


----------



## xy16644 (Dec 10, 2009)

Many thanks, thats most useful!


----------

