From owner-freebsd-questions@FreeBSD.ORG Tue Feb 1 07:24:40 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00C6216A4CE for ; Tue, 1 Feb 2005 07:24:40 +0000 (GMT) Received: from weller-fahy.com (pD9FFED1D.dip.t-dialin.net [217.255.237.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id A84AE43D2F for ; Tue, 1 Feb 2005 07:24:38 +0000 (GMT) (envelope-from dave-lists-freebsd-questions@weller-fahy.com) Received: (qmail 20209 invoked by uid 1001); 1 Feb 2005 07:24:37 -0000 Date: Tue, 1 Feb 2005 08:24:37 +0100 From: "David J. Weller-Fahy" To: freebsd-questions@freebsd.org Message-ID: <20050201072415.GB87827@weller-fahy.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <200502010132.j111WhkT007090@smtp3.server.rpi.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="98e8jtXdkpgskNou" Content-Disposition: inline In-Reply-To: <200502010132.j111WhkT007090@smtp3.server.rpi.edu> X-URL-Me: http://weller-fahy.com X-Accept-Language: en X-Location: Germany, Gangelt, Hof Grootfeld User-Agent: Mutt/1.5.6i X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Re: Cleaning Out Ports? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2005 07:24:40 -0000 --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Matt LaPlante [2005-02-01 02:36 +0100]: > I know the ports system is designed to install dependencies > automatically, but how does one go about removing them? Say one large > package installs several dependencies, but then later on that package > is removed...and now we're left with several orphaned packages. Is > there a way to either detect, or even automatically clean out orphaned > packages? I'm particularly concerned because I'm dealing with a few > systems which are rather well aged, and have gone through several > upgrade cycles. I know the Linux version of the ports system found in > Gentoo (portage) offers extensive functionality for finding and > removing orphaned dependencies, so I'm hoping FreeBSD has some such > feature as well. Thanks. You might want to try the attached script, it's what I've been using for a while. Run with any arguments to print output to terminal. Run with no arguments to create a file called 'remove_leaf_ports.sh'. After reviewing the generated script, run it thusly: sudo sh < remove_leaf_ports.sh You can list the prefixes of the ports that you don't want removed in /usr/local/etc/rm_leaf.conf. One prefix per line, no leading/trailing whitespace. The script will not remove any port that is required by any other port. I usually have to run it two or three times after a batch of upgrades/installs. I just got tired of installing ports to manage ports. ;] Attached is my script, and my conf file. Regards, -- dave [ please don't CC me ] --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rm_leaf.conf" ctorrent daemontools getmail gnupg ifgraph isoqlog mathopd mess822 mutt-devel mysql-server p5-Mail-SpamAssassin php4-mysql php4-pcre portaudit portmanager qlogtools qmailanalog safecat samba screen sudo ucspi-ssl ucspi-tcp unrar unzip vim vmailmgr w3m --98e8jtXdkpgskNou--