UCFR(1)
UCFR(1) ๐ Debian GNU/Linux manual
okay so bestie, welcome to ucfr โจ it's from the Debian GNU/Linux manual and it's literally the lil go-between that matches up packages with their config files. let's get into it ๐
โจ NAME โจ
ucfr โ Update Configuration File Registry: associate packages with configuration files ๐ซถ
๐ธ SYNOPSIS ๐ธ
ucfr [options] <Package> <Path to configuration file>
๐ DESCRIPTION ๐
So <Package> is the package that's associated with the configuration file โ like, in some sense it's the owner of it ๐ โ and Path to configuration file is the full path to where that config file actually lives (usually under /etc), the one that the end user might go in and mess with. ๐ ๏ธ
Heads up bestie: usually this means we register actual files, not symbolic links to files. ucfr will follow symbolic links and register the real file, not the symlink. no cap. ๐ฆ
This script keeps up an association between configuration files and packages, and the whole point is to help provide the kinda facilities that dpkg gives you via conffiles โ except for configuration files that aren't shipped in a Debian package but are handled by ucf in the postinst instead. ๐
This script is idempotent โ associating a package to a file multiple times is not an error, we don't do drama here. ๐ But it's normally an error to try to associate a file that's already associated with another packageโฆ though you can override that with the --force option. ๐
๐ OPTIONS ๐
-h,--helpโ prints a short usage message. tiny lil helper, we love her ๐ธ-n,--no-actionโ dry run!! prints the actions that would be taken if the script is invoked, but takes no action. all vibes, zero consequences โจ-d [n],--debug [n]โ sets the debug level to the (optional) level n (ndefaults to1). this turns on copious debugging information. like, so much info. ๐ญ-p,--purgeโ removes all vestiges of the association between the named package and the configuration file from the registry. the association must already exist; if the configuration file is associated with some other package, an error happens โ unless the option--forceis also given. in that case, any associations for the configuration file are removed from the registry, whether or not the package name matches. ๐
this action is idempotent, so asking for an association to be purged multiple times does not result in an error, since attempting to remove a non-existent association is silently ignored โ unless the --verbose option is used, in which case it just issues a diagnostic. ๐ซถ
--root /path/to/chrootโ sets the root directory. defaults to the value of theDPKG_ROOTenvironment variable if it is exported non-empty, and"/"otherwise. the path passed as Path to configuration file will be prefixed with the path given by this option. the default state directory path/var/lib/ucfwill be prefixed with the path from this option. passing the state directory path explicitly via--state-diror theUCF_STATE_DIRenvironment variable will not receive this prefix. lastly, with this option set, configuration settings will be read from/etc/ucf.confin the given chroot path. ๐ง-v,--verboseโ makes the script be very verbose about setting internal variables. she's a talker fr fr ๐ฌ-f,--forceโ this option forces operations requested even if the configuration file in consideration is owned by another package. this allows a package to hijack a configuration file from another package, or to purge the association between the file and some other package in the registry. ๐ณ yes, "hijack" is the actual word, she's dramatic like that--state-dir /path/to/dirโ sets the state directory to/path/to/dirinstead of the default/var/lib/ucf. used mostly for testing. ๐งช
๐ USAGE ๐
The most common case usage is pretty simple, bestie: a single line invocation in the postinst on configure, and another single line in the postrm to tell ucfr to forget about the association with the configuration file on purge (using the --purge option) โ that's all that is needed (assuming ucfr is still on the system). two lines. that's it. iconic. โจ
๐ฆ ENVIRONMENT VARIABLES ๐ฆ
When the DPKG_ROOT variable is set and not empty, ucfr will operate on the chroot in the path provided by this environment variable. see the --root option for details. ๐
๐ FILES ๐
/var/lib/ucf/registry, and /var/lib/ucf/registry.X, where X is a small integer, where previous versions of the registry are stored.
/etc/ucf.conf
๐ EXAMPLES ๐
If the package foo wants to use ucfr to associate itself with a configuration file foo.conf, a simple invocation of ucfr in the postinst file is all that is needed:
ucfr foo /etc/foo.conf
On purge, one should tell ucf to forget about the file (see detailed examples in /usr/share/doc/ucf/examples):
ucfr --purge foo /etc/foo.conf
If you want to remove all the conf files for a given package foo, the simplest way is to use ucfq. For example:
ucfq -w foo | cut -d : -f 1 | while read cfile ; do ucfr -v $cfile ; done
โญ SEE ALSO โญ
๐ AUTHOR ๐
This manual page was written by Manoj Srivastava <srivasta@debian.org>, for the Debian GNU/Linux system. ๐ซถ
and that's the whole page bestie!! ๐ this one's from Debian, dated Feb 16 2018 โ go forth and register those config files, you absolute main character ๐๐ ๐
๐ฆ where this page comes from
- ubuntu stonking: ucf 3.0056 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms