Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Apr 2003 12:20:52 -0600
From:      Mike Meyer <mwm-dated-1049912455.a8b6ce@mired.org>
To:        Adam <blueeskimo@gmx.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to list installed ports that have no dependant ports
Message-ID:  <16013.52484.125528.851826@guru.mired.org>
In-Reply-To: <1049438180.27963.60.camel@jake>
References:  <1049438180.27963.60.camel@jake>

next in thread | previous in thread | raw e-mail | index | archive | help
In <1049438180.27963.60.camel@jake>, Adam <blueeskimo@gmx.net> typed:
> So, what I'd like to do is list all the ports installed on my box that
> have nothing dependant on them. In this way, I could start removing
> things that I don't need anymore. 
> 
> Is there any clever way to do this? I've toyed around with a few ideas,
> but haven't been able to come up with anything that works nicely.

Since you want to delete them, why don't you just use pkg_delete on
them. If they something depends on them, they won't be deleted.

So the recommended methodology is:

Put a sorted list of ports you know you want to keep in "keeps".

Generate a list of things to try and delete by

(cd /var/db/pkg; ls | sort) | comm -23 - keeps | xargs pkg_delete

and keep doing that as long as things are vanishing from /var/db/pkg.

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16013.52484.125528.851826>