From owner-freebsd-stable Fri Sep 14 13:36:10 2001 Delivered-To: freebsd-stable@freebsd.org Received: from robin.mail.pas.earthlink.net (robin.mail.pas.earthlink.net [207.217.120.65]) by hub.freebsd.org (Postfix) with ESMTP id 642B837B40C for ; Fri, 14 Sep 2001 13:36:07 -0700 (PDT) Received: from earthlink.net (sdn-ar-004dcwashP171.dialsprint.net [206.133.21.211]) by robin.mail.pas.earthlink.net (8.11.5/8.9.3) with ESMTP id f8EKa5f18939; Fri, 14 Sep 2001 13:36:06 -0700 (PDT) Received: by earthlink.net (Postfix, from userid 1001) id 8286250CED; Fri, 14 Sep 2001 16:36:36 -0400 (EDT) Date: Fri, 14 Sep 2001 16:36:36 -0400 From: parv To: Thomas Stratmann Cc: stable@freebsd.org Subject: Re: Removing unused packages? Message-ID: <20010914163636.A1185@moo.holy.cow> Mail-Followup-To: Thomas Stratmann , stable@freebsd.org References: <3BA24709.A1EBC186@ruhr-uni-bochum.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3BA24709.A1EBC186@ruhr-uni-bochum.de>; from thomas.stratmann@ruhr-uni-bochum.de on Fri, Sep 14, 2001 at 08:06:01PM +0200 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG this was, on the fateful occasion around Sep 14 14:06 -0400, sent by Thomas Stratmann > > Hi all, > > I dumped into the need to remove all packages that are not required by > any other, excluding some I am willing to keep (on a > decide-foreach-basis). Is there any tool or option to the pkg_* tools to > help me with this? > > I made this perl script > > open(PKGS, "ls /var/db/pkg |"); > while () { > chomp; > $files = `ls /var/db/pkg/$_`; > > if (!($files =~ /REQUIRED_BY/g)) { > print; > print "\n"; > } > } > > which, I hope, dumps me the bottom-leaf packages installed... ... see pkg_info(1), especially the -[rR] options & portupgrade(1) and -[nrR] options. also, be careful when you go un-installing by solely depending on the the presence, or content of, +REQUIRED_BY, file as that file may be missing or not properly updated... say if you install/deinstall/install in a dependency port directory. sorry for that long "sentence". - parv -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message