# Can I delete /usr/ports?



## phantomfl (Jul 28, 2014)

I did a `portsnap fetch` and `extract`, installed all the ports I needed to install and now I feel like freeing the 1G 1 GB that my /usr/ports takes. Can I delete /usr/ports, or will I still need this directory for uninstalling or upgrading ports in the future?

Sorry if this is a trivial question, FreeBSD newbie here.


----------



## SirDice (Jul 28, 2014)

Yes, you're going to need it every time you build from ports. Instead of removing it completely, clean it out. Make sure there are no work directories around. Also, /usr/ports/distfiles needs regular cleaning to remove old distfiles (you can remove all files, they will be downloaded again when needed). 

`rm -rf /usr/ports/*/*/work`


----------



## wblock@ (Jul 28, 2014)

Unless that computer is isolated from the Internet and does not need ports updates, or the space occupied by the ports tree is really needed for something else, keep it.  Updating will be quicker and easier.


----------



## bsdkeith (Jul 28, 2014)

You wouldn't need it if you install only from packages.


----------



## phantomfl (Jul 29, 2014)

Keeping /usr/ports clean rather than deleting it seems like a good option for me. 1 GB of drive is not the world, but I didn't want to keep something that I will not use again. Thanks for all answers and suggestions.


----------



## uzsolt (Jul 29, 2014)

Maybe you can set WRKDIRPREFIX (see ports(7)).


----------

