You are not logged in.
Suppose I modify a file called /etc/examplefile.conf from a package example-package.
What is the easiest / most elegant way to reset this file? Reset = restore the file to its original, removing my modifications.
This[1] topic discusses this, but it is two years old. I would say the "best" solution there was the one suggested in #7:
you could move the config file first then reinstall.
But I'm not sure if this is safe. For a dummy example, removing /etc/pacman.conf then reinstalling pacman wouldn't probably be a good idea (I suspect this wouldn't work).
OBS.: Getting the original file from the package from the cache is an obvious solution, but I'm searching for a simpler (more direct) way to do this (a bash/zsh one-liner would be sufficient, for example).
[1]: https://bbs.archlinux.org/viewtopic.php?id=137526
Last edited by thiagowfx (2014-04-26 21:49:20)
Offline
I think pacman is a special case, since that is what you are using to actually install the package. So of course if you move the config and break pacman it is not going to work.
But with most other packages the removal (or backup) of the config and then reinstallation seems like the easiest way to me.
Offline
Check out Xyne's pkg-extract_original http://xyne.archlinux.ca/projects/pkg_scripts/
Offline
@WonderWoofy That's right, I guess this is still a good solution if one is in a hurry.
Thank you @karol, this is what I was expecting. This is a typical one-liner:
pkg-extract_original /etc/resolv.conf > /etc/resolv.conf(Warning: do not try this with /etc/pacman.conf, it won't work...)
Offline
FYI, pkg_scripts are available both in the AUR https://aur.archlinux.org/packages/pkg_scripts/ and in Xyne's repo: https://wiki.archlinux.org/index.php/Un … #xyne-i686 or https://wiki.archlinux.org/index.php/Un … #xyne-i686
Offline