From owner-freebsd-stable Fri Sep 14 11:33:14 2001 Delivered-To: freebsd-stable@freebsd.org Received: from pc1-cove4-0-cust214.bir.cable.ntl.com (pc1-cove4-0-cust214.bir.cable.ntl.com [213.105.93.214]) by hub.freebsd.org (Postfix) with ESMTP id BFFC237B416 for ; Fri, 14 Sep 2001 11:33:09 -0700 (PDT) Received: from ntlworld.com (alpha.private [192.168.0.2]) (authenticated) by pc1-cove4-0-cust214.bir.cable.ntl.com (8.11.3/8.11.3) with ESMTP id f8EIWvm27443 (using TLSv1/SSLv3 with cipher RC4-MD5 (128 bits) verified NO); Fri, 14 Sep 2001 19:33:06 +0100 (BST) (envelope-from ianjhart@ntlworld.com) Message-ID: <3BA24D59.DC432A8A@ntlworld.com> Date: Fri, 14 Sep 2001 19:32:57 +0100 From: ian j hart X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Thomas Stratmann Cc: stable@FreeBSD.ORG Subject: Re: Removing unused packages? References: <3BA24709.A1EBC186@ruhr-uni-bochum.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Thomas Stratmann wrote: > > 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... > If there is no such tool or option as mentioned above, please let me > know if there are any problems with the script (I do not go for any > price in beauty, as you can see...). If it works well, it might then be > of use to some of you. pkg_delete -i "*" This should refuse to delete packages with dependencies even if you respond yes. Of course I didn't test this :) I've taken to packaging everything I build from ports. This way you can just do... pkg_delete -a ...then pkg_add from the built copies. You'll see the advantage if you ever build KDE from ports (18hrs for me!). > > Cheers > Thomas Stratmann > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message HTH -- ian j hart To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message