r/archlinux • u/friciwolf • 2d ago
QUESTION Arch Packaging Guidelines -- Empty Config Files
I have just found that the ncdu package accepts global config files in /etc/ncdu.conf yet the arch package does not delivers any.
Why is it so? Would not it be more convenient if pacman managed that config file and not the user? Or is there something in the guidelines about it that I'm missing?
4
u/archover 1d ago edited 1d ago
Agree with the others, copy the system provided configs to your home. Regardless either the wiki or man tells you the format of the config file.
Now, other beginner friendly distros like MInt will provide more user config file support, I''m sure.
Glad to see you in Arch, and good day.
5
u/falxfour 2d ago
IIRC, files in /etc are intended for the system administrator, and as such, aren't something that a package maintainer should generally modify. You'd expect default configs to be in /usr.
Many programs use this hierarchy (ascending order):
/usrfor the package defaults/etcfor the system administrator~/.config(or the XDG equivalent) for the user
I've only really seen systemd put config files in /etc by default, but those just show the actual defaults. I don't even think they get clobbered by updates. systemd also encourages the use of drop-in configs, which mostly sidesteps the problem anyway
2
5
u/No-Dentist-1645 2d ago
No, quite the opposite in fact. Shipping config files is usually the exact opposite of what you want to do.
If a package shipped with config files, that would mean that if the user ever modified the config files (which users are supposed to do, that's exactly what config files are for), then every time the package updated, you would get update conflicts because the file is not the same, and you would need to address and solve the conflict manually.
Besides, what would they ship inside config files? There's no config setup that "works exactly as everyone wants them to". Usually, the defaults are meant to be the "common case" approach, and that's what you get if there is no config file.
9
u/boomboomsubban 2d ago
a package shipped with config files, that would mean that if the user ever modified the config files (which users are supposed to do, that's exactly what config files are for), then every time the package updated, you would get update conflicts because the file is not the same, and you would need to address and solve the conflict manually.
That's what pacnew files are, it's how arch works currently.
3
u/No-Dentist-1645 2d ago
Correct, and you have to "address" them eventually, if you don't want your storage space to fill up with them :)
2
u/Dry_Calendar_8627 2d ago
Wouldn't it be best to have a config file with all default options documented (and commented out), along with instructions for users to put their configuration in e.g. /etc/ncdu.d, so it's not overwritten?
It would be more discoverable, at the cost of a bit of clutter?
I guess it's up to each package maintainers?
3
u/No-Dentist-1645 2d ago
This is usually the responsibility up to the applications themselves to generate a config file with defaults upon first launch. At least that's how it's done for most applications and wms such as Niri. It makes sense, a config file with defaults should not be a responsibility to each individual distro packaging the app and should just come out of the box
-1
u/friciwolf 2d ago
Take this: the maintainer of the program has died in March (2026):
https://code.blicky.net/yorhel/ncdu/issues/276Time for a fork I guess?
1
u/No-Dentist-1645 2d ago
I mean, yeah? Same if the maintainer of a package dies, someone else has to carry the torch.
3
u/lritzdorf 2d ago
Arch sometimes does this, for example with systemd-logind's
/etc/systemd/logind.conf. I'd assume this is partially up to the maintainers, but also, note that systemd-logind actually provides that default file whereas ncdu does not.Edit: u/No-Dentest-1645, generating a config file doesn't really make sense at the system level. For per-user stuff like WM configs, sure, but that's different. Also, those config files tend not to be "generated" anyway, but instead copied from a system location into the user's homedir (so the system-level one still has to be packaged)
0
1
u/Just_Scar4703 1d ago
Try `find /etc -type f -exec pacman -Qqo {} + 2> /dev/null`
e.g. clamav, openssh, and sudo ship config files
9
u/boomboomsubban 2d ago
ncdu does not seem to ship with a default conf, and Arch usually follows upstream.