Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2003 11:14:35 +0200
From:      Uwe Doering <gemini@geminix.org>
To:        questions@freebsd.org
Subject:   Re: Best way to cleanly uninstall packages?
Message-ID:  <3F964A7B.6030405@geminix.org>
In-Reply-To: <941EC83D6E678C4CA92EE2AAE55874F78022@gir.routemaster.net>
References:  <941EC83D6E678C4CA92EE2AAE55874F78022@gir.routemaster.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <packagename>

and feed the resulting list of required packages to

   pkg_info -R <packagename> [<packagename> ...]

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



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