Purge all removed packages ?
Matthew Seaman
m.seaman at infracaninophile.co.uk
Fri Dec 9 09:02:59 PST 2005
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
More information about the freebsd-questions
mailing list