# How to identify and uninstall unnecessary packages



## tommyjung (Sep 2, 2012)

I installed openjdk and realized that I don't really need it.
In the process, whole crap loads of dependent packages were installed.

Is there an effective way to identify which one I don't need and uninstall them?

tommy


----------



## wblock@ (Sep 2, 2012)

There's ports-mgmt/pkg_cutleaves.


----------



## anton (Sep 4, 2012)

if you use portmaster, 
	
	



```
portmaster -L
```
 will show ports categorized by dependency. Look for root and leaf ports (ports that no other port is dependent upon).


----------



## jrm@ (Sep 4, 2012)

If you are using the new package manager, pkgng, you can use the command below.
`# pkg autoremove`


----------

