From owner-freebsd-questions@FreeBSD.ORG Wed Oct 22 02:14:40 2003 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 A067916A4B3 for ; Wed, 22 Oct 2003 02:14:40 -0700 (PDT) Received: from geminix.org (gen129.n001.c02.escapebox.net [213.73.91.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0F1943FB1 for ; Wed, 22 Oct 2003 02:14:39 -0700 (PDT) (envelope-from gemini@geminix.org) Message-ID: <3F964A7B.6030405@geminix.org> Date: Wed, 22 Oct 2003 11:14:35 +0200 From: Uwe Doering Organization: Private UNIX Site User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031019 X-Accept-Language: en-us, en MIME-Version: 1.0 To: questions@freebsd.org References: <941EC83D6E678C4CA92EE2AAE55874F78022@gir.routemaster.net> In-Reply-To: <941EC83D6E678C4CA92EE2AAE55874F78022@gir.routemaster.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Received: from gemini by geminix.org with asmtp (TLSv1:AES256-SHA:256) (Exim 3.36 #1) id 1ACF4f-000N4i-00; Wed, 22 Oct 2003 11:14:38 +0200 Subject: Re: Best way to cleanly uninstall packages? 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: Wed, 22 Oct 2003 09:14:40 -0000 Hi Chris, Chris Richards wrote: > Hi Everyone, > > I have installed 2 packages which inturn installed a bunch of > dependencies... They are "imageindex-1.0.6" and "gallery-1.4.0.1" I was > seeing which one I like best - now I have decided I want to keep gallery > and uninstall imageindex. > > What is the cleanest way to do this? I have noticed that they both have > common dependencies so I can't just use the "pkg_delete -r" option - I > am sure this is a common problem and there is probably an easy way to > uninstall all dependencies for imageindex except for the ones that are > needed for gallery. I think the '-r' option of 'pkg_delete' is not what you are looking for because it works the other way round. It additionally deletes packages that depend on the package you would like to deinstall. I understand what you would like to do is get rid of packages that the package to be deleted depends on, in order to tidy up after deciding on which of the two photo gallery packages to keep. I don't know whether there is a more elegant method that would do this in one go, but what I would do is list the required packages with pkg_info -r and feed the resulting list of required packages to pkg_info -R [ ...] Pick those packages as additional candidates for removal that list only the package that you want to remove in the first place. Now do the whole process again for these additional packages and work your way down the dependency tree recursively. I recommend to make a sketch of the relevant parts of the tree on old-fashioned paper in order to not get confused. When you're done with that, delete the candidates top down with 'pkg_delete'. If anyone else knows a more automated way, with the base system tools, that is, I would certainly be interested, too. Uwe -- Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers gemini@geminix.org | http://www.escapebox.net