Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
PKG_DEINSTALL(1)        FreeBSD General Commands Manual       PKG_DEINSTALL(1)

     pkg_deinstall - a package deinstaller with wildcards and dependency
     recursion support

     pkg_deinstall [-hacdDfinOPqrRv] [-p prefix] [-x pkgname_glob]
                   [pkgname_glob ...]

     The pkg_deinstall command is a wrapper of pkg_delete(1) used to deinstall
     packages, which understands wildcards and is capable of recursing through

     Before reading these instructions, you must understand that a
     port/package can have the following two types of related ports/packages:
     required   Ports/packages that a port/package needs for it to be built
                and/or run.  Port Makefiles refer to this type of
                ports/packages using the BUILD_DEPENDS and RUN_DEPENDS macros,
     dependent  Ports/packages that need this port/package.

     The following command line arguments are supported.  The options marked
     as `[*]' are transparently passed to pkg_delete(1).

     pkgname_glob        Specify one of these: a full pkgname, a pkgname
                         without version, a shell glob pattern in which you
                         can use wildcards `*', `?', and `[..]', an extended
                         regular expression preceded by a colon `:', or a date
                         range specification preceded by either `<' or `>'.
                         See pkg_glob(1) for details and concrete examples.

     --help              Show help and exit.

     --all               Deinstall all the installed packages.  Equivalent to
                         specify '*' as pkgname_glob.

     --collate           For each package, check if any of the files installed
                         by the package has been overwritten by others.  If
                         any, list them and abort the deinstallation of the
                         package.  This option is disabled by the -f option.

     --rmdir             Remove empty directories created by file cleanup.  By
                         default, only files/directories explicitly listed in
                         a package's contents (either as normal
                         files/directories or with the @dirrm directive) will
                         be removed at deinstallation time.  This option tells
                         pkg_deinstall to also remove any directories that
                         were emptied as a result of removing the package. [*]

     --noscripts         If a deinstallation script exists for a given
                         package, do not execute it. [*]

     --force             Force removal of the package, even if a dependency is
                         recorded or the deinstall or require script fails.

     --interactive       Request confirmation before attempting to delete each
                         package, regardless whether or not the standard input
                         device is a terminal.

     --noexecute         Do not actually deinstall a package, just report the
                         steps that would be taken if it were. [*]

     --omit-check        Omit sanity checks for dependencies.  By default,
                         pkg_deinstall checks if all the packages to deinstall
                         have consistent dependencies, though it takes extra
                         time to calculate dependencies.  If you are sure you
                         have run ``pkgdb -F'' in advance, you can specify
                         this option to omit the sanity checks.

     -p prefix
     --prefix prefix     Set prefix as the directory in which to delete files
                         from any installed packages which do not explicitly
                         set theirs.  For most packages, the prefix will be
                         set automatically to the installed location by
                         pkg_add(1).  [*]

     --preserve          Preserve FreeBSD shared library files.  pkg_deinstall
                         invokes file(1) to check if each file with the
                         ``.so.X'', or ``.so.X.Y'' suffix is a FreeBSD shared
                         library, copies all the found shared libraries to
                         $LOCALBASE/lib/compat/pkg, and runs ldconfig(8) to
                         update the ldconfig cache.

                         This option is useful when you suspect that you still
                         have some binaries that depend on the shared library
                         being deleted.

     --noconfig          Do not read the configuration file.

     --recursive         Deinstall all those packages depending on the given
                         packages as well.

     --upward-recursive  Deinstall all those packages required by the given
                         packages as well.

     --verbose           Turn on verbose output. [*]

     -x pkgname_glob
     --exclude pkgname_glob
                         Exclude packages matching the specified glob pattern.
                         Exclusion is performed after recursing dependency in
                         response to -r and/or -R, which means, for example,
                         the following command will deinstall all the packages
                         depending on XFree86 but leave XFree86 as it is:

                         pkg_deinstall -rx XFree86 XFree86

     PKG_DBDIR      Alternative location for the installed package database.
                    Default is ``/var/db/pkg''

     PKGTOOLS_CONF  Configuration file for the pkgtools suite.  Default is

     /var/db/pkg                Default location of the installed package

     $LOCALBASE/lib/compat/pkg  Location where shared library files are

     $PREFIX/etc/pkgtools.conf  Default location of the pkgtools configuration

     pkg_add(1), pkg_delete(1), pkg_glob(1), pkg_info(1), pkg_sort(1),
     pkgdb(1), portinstall(1), portsclean(1), portupgrade(1),
     pkgtools.conf(5), ports(7)

     Akinori MUSHA <>

FreeBSD                          June 13, 2006                         FreeBSD


Want to link to this manual page? Use this URL:

home | help