Complete Port Removal Question

Abu Khaled khaled.abu at
Fri Jun 17 06:58:43 GMT 2005

On 6/16/05, John Brooks <john at> wrote:
> "pkg_info -r <pkgname>"    shows dependencies
> "pkg_delete -r <pkgname>"     removes pkg and dependencies
> --
> John Brooks
> john at
> > -----Original Message-----
> > From: owner-freebsd-questions at
> > [mailto:owner-freebsd-questions at]On Behalf Of M. Goodell
> > Sent: Thursday, June 16, 2005 10:24 AM
> > To: FreeBSD Questions
> > Subject: Complete Port Removal Question
> >
> >
> >
> > How can I remove a port and all of it's dependencies from a
> > system? For example, I installed sqWebmail and tried it out then
> > decided it's not what we were looking for. Now, I would like to
> > not only remove sqWebmail but all of the stuff it installed along with it.
> >
> > sqwebmail also installed things like:
> >
> > - courier-authlib-base-0.56
> > - ispell-3.2.06_13
> >
> > and others as well
> >
> > Is there a safe / quick way to remove the dependencies for a port
> > and not break the rest of the system by removing stuff other
> > things depend on? For example, I don't want to remove Perl
> > obviously which is a dependency of sqwebmail.

I guess pkg_delete -r <portname> is not what he asked for since it
well deinstall all those depending on the given package/port. He wants
to einstall all those required by the given package/port.

for example gmake-3.80_2
# pkg_info -r gmake-3.80_2
Information for gmake-3.80_2:

Depends on:
Dependency: libiconv-1.9.2_1
Dependency: gettext-0.14.4_1

# pkg_delete -r gmake-3.80_2
This well only remove gmake-3.80_2 but not what gmake depends on to
run (libiconv and gettext) and to build (libtool)

There are alos build dependenies that would not be removed since they
are only required to build the package/port but not to run it (libtool
for example is required to build gmake but not to run it).

I use portupgrade and its tools to install/remove packages/ports.
for example if I want to remove gmake and all it's 'RUN' dependencies
(libiconv and gettext)

# pkg_deinstall -iR gmake
This well prompt for each step to remove gmake and ports needed to run
it but libtool well not get removed or asked for to be removed since
it is not required to run gmake.

There are many tools in /usr/ports/sysutils that well help you remove
packages/ports not required to run allready installed ports/packages.


My favorite all is portupgrade since it has many utilities for example

Try to install portupgrade then

# pkg_deinstall -iR sqwebmail

the -i option request confirmation for each package removal
The -R option Deinstall all those required by the given packages as well.
Aftrer removing sqwebmail it well ask you to remove
- courier-authlib-base-0.56
- ispell-3.2.06_13

as well perl and/or other dependencies so don't forget to answer with
"no" for packages you need.

Kind regards
Abu Khaled

More information about the freebsd-questions mailing list