# removing unwanted ports



## nu2fbsd (Mar 5, 2010)

I have done a search in the forums for this and did not find any post. I would like to get rid of dir and files in /usr/ports that are not needed like chinese, japanese, arabic etc can I do that and is there any shortcut to doing that? I am using Enlightenment window manager. I know about `# rm` for files and `# rmdir`for dir. But there are subdir which lengthen the process for deletion.


----------



## sixtydoses (Mar 5, 2010)

Probably this will do the trick.

From man portsnap.conf(5)


> Finally, a line of the form
> REFUSE foo bar
> will instruct portsnap(8) to ignore parts of the ports tree with paths starting with foo or bar, which are interpreted as extended regular expressions by egrep(1). This will result in those parts of the tree not being updated in the compressed snapshot when the fetch and cron commands are used and not being extracted when the extract command is used (unless a specific path is passed to portsnap(8)), and if those parts of the ports tree are present they will not be updated when the update command is used. Unlike the other options, the parameters in REFUSE lines accumulate and all such lines are considered. Note that operating with an incomplete ports tree is not supported and may cause unexpected results.


----------



## nu2fbsd (Mar 5, 2010)

Is that a line in portsnap.conf I need to add or what?


----------



## sixtydoses (Mar 5, 2010)

nu2fbsd said:
			
		

> Is that a line in portsnap.conf I need to add or what?


Yes. 

e.g.:

```
REFUSE chinese korean games
```


----------



## nu2fbsd (Mar 5, 2010)

where is this file?


----------



## sixtydoses (Mar 5, 2010)

/etc/portsnap.conf

However,


> Note: If Portsnap is installed from the FreeBSD Ports Collection, it will use the configuration file /usr/local/etc/portsnap.conf instead of /etc/portsnap.conf. This configuration file is not created when the port is installed, but a sample configuration file is distributed; to copy it into place, run the following command:
> 
> # cd /usr/local/etc && cp portsnap.conf.sample portsnap.conf



http://www.freebsd.org/doc/en/books/handbook/portsnap.html


----------



## DutchDaemon (Mar 5, 2010)

@nu2fbsd: questions about ports and the ports tree belong in the "Installation and Maintenance of FreeBSD Ports or Packages" forum.


----------

