# Delete unsuccessful port build dependencies



## Business_Woman (Aug 31, 2011)

Hi,

I started to build emacs but it failed because of some dependency problem.
How do you remove all the dependencies emacs did install before it failed?

Pkg_delete -xr emacs gives "no such package installed"


----------



## DutchDaemon (Sep 1, 2011)

Try [cmd=]portmaster --check-depends[/cmd] plus [cmd=]portmaster -s[/cmd]


----------



## wblock@ (Sep 1, 2011)

Any dependencies that were built successfully were installed and don't need to be deleted.  The ones that failed to build didn't install, so the only detritus left is in the port work directories.  make clean from the main port will clear that up, but so will the automatic port update utilities like port[master|upgrade].


----------



## Maredelamer (Sep 1, 2011)

As wblock mentioned an aborted port may leave successfully installed pieces behind that are not or potentially not going to be used.

`# portmaster --check-depends`
`# portmaster -s`
Will not help ports that are correctly installed, of course, however Using the output of 
`# portmaster -l`
specifically the following two sections,

```
===>>> Root ports (No dependencies, not depended on)
===>>> Leaf ports (Have dependencies, not depended on)
```
can illustrate what is installed that may not be wanted/needed, then using 
`# portmaster -e`
on the ports in question to remove them and (optionally) their dependencies and distfiles may be necessary.


I recently mistakenly started building editors/libreoffice-legacy without realizing it used the configuration from editors/libreoffice resulting in pulling in a mess of QT4 files and other related and now unwanted/needed ports.

This would seem to work, but as I am blundering my way to knowledge the above may not be the best way.


----------

