not dead [yet].

b. f. bf1783 at googlemail.com
Tue Aug 4 22:37:48 UTC 2009


Roland Smith <rsmith at xs4all.nl> wrote:
>What you can do is make a list of all installed ports with ports-mgmt/portmaster:
>  portmaster -L >ports.list
>
>Looking through this list, you'll see four categories;
>- Root ports (No dependencies, not depended on)
>- Trunk ports (No dependencies, are depended on)
>- Branch ports (Have dependencies, are depended on)
>- Leaf ports (Have dependencies, not depended on)
>
>Basically, you can delete any of the leaf and root ports, because
>they're not depended on. E.g. if you have the following in your list as
>a leaf port:
>  ===>>> qemu-0.10.6
>you can execute 'pkg_delete -d qemu-0.10.6' as root, and it is gone.

If you're only interested in deletion, "-l" should be preferred to
"-L".  And portmaster with these flags does not always account for
build dependencies. so with this method you may occasionally remove a
port that is only used to build other ports, but is not a runtime
dependency of any other port.  Also, occasionally a port Makefile
doesn't properly account for some dependencies, and removing them will
break the port.  So there may be some breakages that you'll have to
fix, but this shouldn't happen often.

When removing ports, I sometimes use pkg_deinstall -vR, sometimes also
with -i.   because it can clean out the now-unneeded dependencies of
the port I'm removing, which speeds up this process. Provided your
pkgdb and portsdb are up-to-date, it's a little better than portmaster
-s, which relies on +REQUIRED_BY to detect stale dependencies, and may
occasionally fail.

b.


More information about the freebsd-questions mailing list