You are not logged in.
First of all, yes I've searched, I've seen the warnings (which are what basically leads to this post) and I see and understand that --force is not recommended and should only be used when anointed by burning sage. But...
My workload has multiplied lately due to a particular setup which people seem to like and I've been having to do various installs of a particular configuration. Manually, I pacman various packages and then sed/echo my way through the configuration files to get it set up; I've gotten it standardized in a text file (1694 Kb) with all the commands and run them in batches through SSH.
Now, what would the consequences be of me creating a package with those files, listing the other necessary packages as dependencies and then pacman -U --force meta.pkg.tar.xz causing it to overwrite the configuration files all in one step. Since I would write the PKGBUILD myself I would know exactly what gets written over, and post-install I run a test script that checks everything is working correctly.
I've tried it out in a testing vbox and haven't seen any issues; so I'm 90% sure that it would work, but the general warnings and omens about --force make me triple-check to ensure that remaining 10% doesn't do something disastrous.
Offline
You are using --force for a custome package in special circumstances so, I believe you don't need a signal from burning sages. What you are doing is outside the purview of them. Anyway noone here knows what you are doing actually (commands and configs you use).
Arch is home!
https://github.com/Docbroke
Offline
Do consider the fact that pacman 5.1 will deprecate --force in favor of --overwrite <glob> and eventually --force will be completely removed.
Anyway I'd generally recommend using conf.d dropins where possible, and ultimately using something like etckeeper to track your configurations in a somewhat more reliable manner.
That being said, there is no reason in theory that you couldn't use --force. Of course, you'd have to delete it afterward or you'd get file conflicts when trying to update any of the packages it clashes with... at that point you might as well just untar "meta-archive.tar.gz" without doing anything with pacman.
Or use etckeeper or some custom bash script which uses sed. ![]()
Last edited by eschwartz (2017-08-23 06:29:27)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
It seems to me you are just complicating things and most probably planning to set some kind of hard to debug problem later on. Pacman complains about duplicate files for a good reason, to avoid exactly what you are trying to do.
Don't forget that the original packages will always come with the files you want to overwrite and you will have to merge changes when things change in .conf files. I'd say just skip the part about creating a package and overwrite the files directly but make sure your custom configuration files are kept up-to-date with changes in the original configuration files or you may find your new setups borked without an apparent obvious explanation.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
You are correct in your assumption that using --force will serve your purposes fine. However, I would take this moment to echo Eschwartz's comments. When you do this, you are going to cause file conflicts later if you ever want to update those packages from which you've overwritten files.
Using conf.d drop-ins for any application which supports it will make life a lot simpler. Further, if you use a more sensible system for maintaining your configurations (like etckeeper), you will be much happier in the long run.
All the best,
-HG
Offline
Thank you all for your replies. I wasn't thinking ahead and just looking to solve my issue _now_, as usual, this was a bad approach.
I think I'll just write a few bash scripts that backup the original configuration files and then push my confs into the appropriate /etc locations. Things like puppet/chef/etckeeper are a bit too much for what I need and all require installing various services and scripts which I would have to test/certify before putting into production. Maybe I'll take a page out of them and expand my scripts to include checksums and periodic reviews of new/changed confs.
Offline
Why not use one of the multiple existing tools to manage configurations?
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline