PDA

View Full Version : Removing orphaned packages


GullibleJones
November 19th, 2008, 18:46
What's the best way to remove orphaned packages on FreeBSD, i.e. dependencies of packages that have been uninstalled? I've tried pkg_rmleaves, pkg_cleanup, and pkg-orphan, but none of those three even detect orphaned packages properly. If, for instance, I install and uninstall porttools, that will leave sudo, ruby, and a bunch of other packages I don't need installed, of which pkg_rmleaves will only detect sudo.

Suppose a FreeBSD guru installs something huge, with lots of deps, and later he wants to remove it and all of its dependencies. How does he go about doing that?

anomie
November 19th, 2008, 18:54
I've used pkg-orphan (which you mentioned) for this purpose. Did you use it with the -r option?

DutchDaemon
November 19th, 2008, 18:56
Isn't that something portmaster -s should be able to do? Never tested it myself.

-s clean out stale ports that used to be depended on

mousaka
November 19th, 2008, 20:04
I use pkg_cutleaves.

mousaka

SeanC
November 19th, 2008, 22:01
I second pkg_cutleaves, but proceed with caution. Portsclean (with -C -DD and -L options) is also handy to clean out distfiles.