Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Dec 2005 17:02:37 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Mehmet Fatih AKBULUT <mfatihakbulut@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Purge all removed packages ?
Message-ID:  <4399B8AD.5040708@infracaninophile.co.uk>
In-Reply-To: <eed667140512090439y7cc0d1a8wd6939129339d4d59@mail.gmail.com>
References:  <eed667140512090439y7cc0d1a8wd6939129339d4d59@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Mehmet Fatih AKBULUT wrote:

> how can i purge all removed packages ?
> does freebsd has something like this : *dpkg -l | awk '/^rc/ {print $2}' |
> xargs dpkg --purge *??? (which works on debian!)

The FreeBSD package system doesn't really have the concept of a special
command to remove files that are part of a package but which are user
editable and preserved when the main body of the package is removed.

In general, preservation of local configuration is handled in one of
three ways:

   i) It isn't preserved at all.  Deleting the port/package will delete
      the configuration files you spent hours tuning to be just right...

  ii) The port installs sample configuration files which you have to copy
      and edit as part of the installation.  Thus the configuration file
      doesn't count as part of the package and will be left behind when
      the package is deleted.

 iii) Very similarly to (ii) a sample configuration file is installed but
      the actual configuration file is automatically created as a copy of
      the sample if the actual file doesn't exist.  At deinstall time, the
      sample and actual configuration files are compared, and the actual
      configuration file will be left untouched if they differ (implying
      that the actual configuration file has been modified).

Remember that in FreeBSD as upgrading a port/package involves a deinstall
followed by an install of the new version, so configuration file handling
is something that most porters pay quite a lot of attention to.  Packages
that use method (i) tend to be quite rare in the tree nowadays.

This does mean that if you delete a bunch of installed packages you tend
to be left with a scattering of miscellaneous files which you would have
to deal with manually if you wanted to get rid of them.  Generally those
files will be found in ${PREFIX}/etc/ (usually /usr/local/etc, but quite
often /usr/X11R6/etc) or subdirectories thereof.  Note that this only
applies to 3rd party software installed via ports/packages.  The base system
has a completely different mechanism for handling updates.

	Cheers,

	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4399B8AD.5040708>