Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#1925 - pacman -U overwrites NoUpgrade files

Attached to Project: Pacman
Opened by dtw (dibblethewrecker) - Wednesday, 22 December 2004, 10:01 GMT
Last edited by Judd Vinet (judd) - Wednesday, 29 December 2004, 17:35 GMT
Task Type Bug Report
Category
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When using pacman -U the files marked as NoUpgrade in pacman.conf appear to be ignored.

In the following situation a user may inadvertantly lose all of his/her config files

pacman -U initscripts-custom

files are backed up to .pacsave ok but ARE overwriten - even if rc.conf is marked NoUpgrade

if they then do

pacman -U initscripts

the new files from initscripts-custom are backed up to pacsave and the originals are lost - the user has assumed his/her custom ones are ok becasue they are marked NoUpgrade, when, in fact, they are now gone.
This task depends upon

Closed by  arjan timmerman (blaasvis)
Sunday, 26 March 2006, 10:34 GMT
Reason for closing:  Fixed
Additional comments about closing:  2.9.8 will look if you changed a file with md5, so no upgrades by default ;)
Comment by Judd Vinet (judd) - Tuesday, 11 January 2005, 23:03 GMT
Please attach the output from pacman when using the --verbose switch, so I can see the md5sum comparisons.

thanks.
Comment by dtw (dibblethewrecker) - Wednesday, 12 January 2005, 02:44 GMT
i'll do that asap - i'm actually having trouble replicating this now - which is strange!
Comment by Raven Morris (Samus_Aran) - Friday, 28 January 2005, 02:59 GMT
Pacman should not ***EVER*** overwrite files in /etc, under any circumstance. This is an absolutely horrible and intollerable bug how Arch Linux behaves this way. Anything at all under /etc which is not a stock file should have new files output as .pacnew, never overwriting. Arch Linux is the only distro I have ever seen that has this critical flaw. At the VERY least it should ask user confirmation to overwrite ANY file in /etc. I have lost a large custom /etc/profile after two Bash updates in one day, not noticing the .pacnew file. At the VERY, VERY, VERY, ***VERY*** least, make it .pacsave.1 then .pacsave.2, etc.
Comment by Raven Morris (Samus_Aran) - Friday, 28 January 2005, 03:01 GMT
Oops, "not noticing the .pacnew file" should be "not noticing the .pacsave file".
Comment by dtw (dibblethewrecker) - Friday, 28 January 2005, 11:13 GMT
i have to say i think your problem is essentially "user error" but i do agree that it is an error far to easy to make - especially if files in /etc are being moved to .pacsave when you don't want them touched at all and assume they aren't.

i think pacsave.1 then .pacsave.2 - is a good idea but could get messy

>>>> At the VERY least it should ask user confirmation to overwrite ANY file in /etc

i think that is a good point BUT pacman DOES tell you when it moves files around
Comment by Raven Morris (Samus_Aran) - Saturday, 29 January 2005, 12:24 GMT
"BUT pacman DOES tell you when it moves files around"

How is a program "telling you" that it is doing something wholley wrong helpful ? It is one line in pages and pages of output when doing a full --sysupgrade. The point is that it should NEVER overwrite a custom configuration file with a distro stock config file. There is *no* sense in doing this. It is *never* a good idea. Anyone that has configured their system custom, does not want it being overwritten when they keep their system up-to-date.

It is one of the biggest things setting Arch Linux back from being a usable server distro -- I can't imagine any server operator trusting a distro that erases their absolutely vital config files, just for the hell of it.
Comment by Raven Morris (Samus_Aran) - Saturday, 29 January 2005, 12:26 GMT
Furthermore there is already a concept of .pacnew, which makes perfect sense. *ALL* files that fall under /etc should be extracted as .pacnew, without any exceptions. If the user ever wishes to revert to a distro stock version of a particular config file, such as PHP's, all they need to do is:

mv /etc/php.ini{.pacnew,}
Comment by dtw (dibblethewrecker) - Tuesday, 01 February 2005, 07:01 GMT
ah - finally - proof of the problem

http://dtw.jiwe.org/share/pacman_errors.rtf

I think that says it all - it is the -U that is the problem
Comment by dtw (dibblethewrecker) - Tuesday, 01 February 2005, 07:07 GMT Comment by Alec Thomas (alecthomas) - Monday, 06 June 2005, 12:15 GMT
I have to agree with Raven, it was quite a "surprise" (not in a good way) when I first did a --sysupgrade and pacman overwrote my custom config files.

I think a less aggressive logic when upgrading packages might be:

if config file is stock, overwrite it, otherwise install new config file as <file>.pacnew
Comment by Greg Meyer (oggb4mp3) - Friday, 26 August 2005, 03:40 GMT
As an observation, urpmi in Mandriva handles config files similarly, but only overwrites the config file if it is not changed from the one originally installed. So if my sshd_config file includes custom mods, the new config file for a version upgrade (which may contain more options or a different default setting) is installed as sshd_config.rpmnew, but if the file was not changed from the previous install, it is overwritten with the new default config file.

IMHO, this is a very sane way of handling this, allowing pacman to roll out new default settings to people that use them, but leaving custom configs alone when they have been put in place by the admin.
Comment by Raven Morris (Samus_Aran) - Friday, 26 August 2005, 04:22 GMT
Greg Meyer:

Yes, I agree, that is the sensible and sane way to do it.
Comment by arjan timmerman (blaasvis) - Sunday, 02 October 2005, 09:27 GMT
status ?
Comment by Roman Kyrylych (Romashka) - Monday, 02 January 2006, 10:59 GMT
See also these comments:
http://bugs.archlinux.org/task/3644

Loading...