You are not logged in.

#1 2011-04-13 18:22:37

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

[SOLVED]pacnew files? i need help...

Hi,
After upgrade with pacman -Syu, a lot of pacnew files in /etc.I read about this in archwiki but i'm still confused :S I have no idea how to use vimdiff or meld ...
Can someone explain me simple what to do with pacnew files.I'm new in arch linux and i need help.
Thanks to everyone. (sorry for my english)

Last edited by grobar87 (2011-04-15 14:26:42)


And... here... we... go!

Offline

#2 2011-04-13 18:31:58

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED]pacnew files? i need help...

a pacnew file is used when an update to a package requires a new configuration file, but there is already a configuration on your system which would be wrong to simply overwrite.

If there is nothing in the old, corresponding file you want to keep, it is okay for you to move the pacnew file and overwrite the old configuration.  If it is not okay, you need to incorporate your customizations into the pacnew file, and then move the pacnew file and overrwrite the old file.

The tools you mentioned are just that -- tools to help figure out what changed.  The easiest solution is just to run diff fileName fileName.pacnew to see the lines that changed.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2011-04-13 18:57:04

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

ewaller wrote:

a pacnew file is used when an update to a package requires a new configuration file, but there is already a configuration on your system which would be wrong to simply overwrite.

If there is nothing in the old, corresponding file you want to keep, it is okay for you to move the pacnew file and overwrite the old configuration.  If it is not okay, you need to incorporate your customizations into the pacnew file, and then move the pacnew file and overrwrite the old file.

The tools you mentioned are just that -- tools to help figure out what changed.  The easiest solution is just to run diff fileName fileName.pacnew to see the lines that changed.

Thanks for reply...I install vim and run diff:

[root@DejanArch dejan]# diff /etc/group /etc/group.pacnew
8c8
< lp:x:7:daemon,dejan
---
> lp:x:7:daemon
11c11
< wheel:x:10:root,dejan
---
> wheel:x:10:root
15a16
> utmp:x:20:
20,28c21,29
< games:x:50:dejan
< network:x:90:dejan
< video:x:91:dejan
< audio:x:92:dejan
< optical:x:93:dejan,hal
< floppy:x:94:hal
< storage:x:95:dejan,hal
< scanner:x:96:dejan
< power:x:98:dejan
---
> games:x:50:
> network:x:90:
> video:x:91:
> audio:x:92:
> optical:x:93:
> floppy:x:94:
> storage:x:95:
> scanner:x:96:
> power:x:98:
31,39d31
< dbus:x:81:
< hal:x:82:
< avahi:x:84:
< usbmux:x:140:
< camera:x:97:dejan
< ntp:x:1000:
< rtkit:x:133:
< deluge:x:125:
< utmp:x:20:

Now? How to merge this two files?
Thanks again.

Last edited by grobar87 (2011-04-13 18:57:50)


And... here... we... go!

Offline

#4 2011-04-13 19:07:00

tuxitop
Member
From: Mashhad, Iran
Registered: 2011-04-04
Posts: 24

Re: [SOLVED]pacnew files? i need help...

what do you mean by merging these two files? if you are satisfied with the pacnew file just do "mv /etc/group.pacnew /etc/group" and that will overwrite /etc/group with /etc/group.pacnew.

Last edited by tuxitop (2011-04-13 19:07:42)

Offline

#5 2011-04-13 19:18:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED]pacnew files? i need help...

Well, lets see:

[root@DejanArch dejan]# diff /etc/group /etc/group.pacnew
8c8
< lp:x:7:daemon,dejan
---
> lp:x:7:daemon
11c11
< wheel:x:10:root,dejan
---
> wheel:x:10:root
15a16
> utmp:x:20:
20,28c21,29
< games:x:50:dejan
< network:x:90:dejan
< video:x:91:dejan
< audio:x:92:dejan
< optical:x:93:dejan,hal
< floppy:x:94:hal
< storage:x:95:dejan,hal
< scanner:x:96:dejan
< power:x:98:dejan
---
> games:x:50:
> network:x:90:
> video:x:91:
> audio:x:92:
> optical:x:93:
> floppy:x:94:
> storage:x:95:
> scanner:x:96:
> power:x:98:

All the Lines with '<' are what you had, lines with '>' are what is pacnew.  It looks like you want to keep all of these lines as they exist in your old file because you have added the user 'dejan' to these groups.

31,39d31
< dbus:x:81:
< hal:x:82:
< avahi:x:84:
< usbmux:x:140:
< camera:x:97:dejan
< ntp:x:1000:
< rtkit:x:133:
< deluge:x:125:
< utmp:x:20:

These lines are a little more problematic.  You have these in your old configuration, but they are not in the new configuration.  What I can say, is that the new configuration does not include anything new (i.e. there is nothing missing from your old configuration)
You need to look at each of these and determine if you need them.

In this case, you can delete the pacnew file.  Then, from your old config, remove any lines that are no longer needed (For example, are you using hal?)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2011-04-13 19:20:59

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [SOLVED]pacnew files? i need help...

tuxitop wrote:

what do you mean by merging these two files? if you are satisfied with the pacnew file just do "mv /etc/group.pacnew /etc/group" and that will overwrite /etc/group with /etc/group.pacnew.

Umm no ....Don't do that randomly. It will not allow you to login in some cases and with the group file especially, you may lose membership to all the groups thereby not allowing you to access your external hard drive or not allowing you to sudo etc. etc.

You have to be sure about what you are doing.

EDIT : Please see what ewaller has suggested in the post above mine.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2011-04-13 19:22:37

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

removed

Last edited by grobar87 (2011-04-13 19:24:22)


And... here... we... go!

Offline

#8 2011-04-13 19:23:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED]pacnew files? i need help...

Inxsible wrote:
tuxitop wrote:

what do you mean by merging these two files? if you are satisfied with the pacnew file just do "mv /etc/group.pacnew /etc/group" and that will overwrite /etc/group with /etc/group.pacnew.

Umm no ....Don't do that randomly. It will not allow you to login in some cases and with the group file especially, you may lose membership to all the groups thereby not allowing you to access your external hard drive or not allowing you to sudo etc. etc.

You have to be sure about what you are doing.

I think this refers to the post from tuxitop.  Regardless, be careful even with my suggestions. /etc/group is a critical file.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2011-04-13 19:25:02

tuxitop
Member
From: Mashhad, Iran
Registered: 2011-04-04
Posts: 24

Re: [SOLVED]pacnew files? i need help...

Inxsible wrote:

Umm no ....Don't do that randomly.

I meant the same when I said "If you are satisfied with...". I'm sorry if it wasn't clear anyway.

Offline

#10 2011-04-13 19:25:54

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED]pacnew files? i need help...

tuxitop wrote:

what do you mean by merging these two files? if you are satisfied with the pacnew file just do "mv /etc/group.pacnew /etc/group" and that will overwrite /etc/group with /etc/group.pacnew.

For heaven's sake, no!! Never simply overwrite a file with its .pacnew update! You will most likely lose your old settings or even worse.

You need to compare the contents both of the original and the .pacnew file. Tools like "vimdiff" allow you to view both files side by side and do visually mark the differences found. You have to inspect those changes line by line and decide whether and how to change the original settings.

This means, you must understand what is in the original file and what effect the changes might have. If ever you are lost with this, come here to the forums and ask for details.

Some tools, like "vimdiff" allow you to apply the changes in place while viewing. This eases the efforts considerably.

But in any case: Keep a backup copy of the original file. Things easily may go wrong, so you can start over if needed.

Last edited by bernarcher (2011-04-13 19:27:52)


To know or not to know ...
... the questions remain forever.

Offline

#11 2011-04-13 19:45:45

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

Thanks to all for reply.I'm not sure that i understand everything now,but i think i will follow @ewaller suggestions in this case and remove pacnew file.


And... here... we... go!

Offline

#12 2011-04-13 20:09:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]pacnew files? i need help...

bernarcher wrote:

This means, you must understand what is in the original file and what effect the changes might have. If ever you are lost with this, come here to the forums and ask for details.

Some tools, like "vimdiff" allow you to apply the changes in place while viewing. This eases the efforts considerably.

+1

I use pacnews which uses vimdiff.

https://wiki.archlinux.org/index.php/En … orig_Files

Offline

#13 2011-04-13 20:25:10

imatechguy
Arch Linux f@h Team Member
Registered: 2010-03-22
Posts: 66

Re: [SOLVED]pacnew files? i need help...

I'd like to add a small suggestion that I've found very helpful when an update creates .pacnew files.  The first thing I do is copy the current file inplace adding a ".old" suffix before I even compare the new file to my existing one.  That way I can always see what I started with, what the .pacnew file is trying to change and my current config file with changes made.  You can even leave everything and just keep overwriting the ".old" file as needed with each upgrade until you're more comfortable with the process.

So using your example (/etc/group) I start with:

/etc/group

After Upgrading I end up with:

/etc/group
/etc/group.pacnew

I then create my copy of the current file (/etc/group) adding the ".old" suffix and then have:

/etc/group
/etc/group.old
/etc/group.pacnew

Now I'm free to compare (/etc/group) to (/etc/group.pacnew) and make any changes needed to (/etc/group).  This way if I mess something up I can use the liveCD to mount the system and compare my ".old" config file to the current one and see where I made the mistake.  There's no worries even if you had a big update and aren't sure what the names of all the files you changed were because you can look in /var/log/pacman.log to review pacman's output and see all the .pacnew notifications.  After you've confirmed everything works as appropriate and had a few sucessful reboots then you can clean up all the ".pacnew" and ".old" files if you don't feel compelled to leave them there for whatever your reason.

Offline

#14 2011-04-13 20:56:33

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

Thanks to all for help and suggestions...i have one more question:
What is the worst thing that can happend if i not handle with pacnew files and leave untouched?Just curious. smile


And... here... we... go!

Offline

#15 2011-04-13 21:03:39

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,538

Re: [SOLVED]pacnew files? i need help...

grobar87 wrote:

What is the worst thing that can happend if i not handle with pacnew files and leave untouched?Just curious. smile

On 2010-09-05 there was a change to pacman.conf that needed to be merged else pacman stopped working.

Offline

#16 2011-04-13 21:23:23

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]pacnew files? i need help...

skunktrader wrote:
grobar87 wrote:

What is the worst thing that can happend if i not handle with pacnew files and leave untouched?Just curious. smile

On 2010-09-05 there was a change to pacman.conf that needed to be merged else pacman stopped working.

Exactly. New versions sometimes require changes to the config to work properly or to work at all.

Offline

#17 2011-04-14 14:34:48

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

Good to know.Thanks for the info and thanks to all for help. smile


And... here... we... go!

Offline

#18 2011-04-14 15:02:04

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,923
Website

Re: [SOLVED]pacnew files? i need help...

No one mentioned community/pacmatic, so I'll chime in:
http://kmkeen.com/pacmatic/


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

#19 2011-04-14 19:11:17

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

Still need help with this... thanks to anyone for help so far,but i'm new in arch and still very confused so i uploaded screenshots:
tODltcg
tODlteQ
tODlteg
I really don't want to break something by doing things without your suggestions.
Thanks for your patience.

Last edited by grobar87 (2011-04-14 19:12:32)


And... here... we... go!

Offline

#20 2011-04-14 19:27:54

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED]pacnew files? i need help...

For the shadow and fstab files, delete the .pacnew versions as those merely contain default stuff and add nothing new.

See the green text? That's what's in the left file but not the right. You don't want to lose any of that. The red on blue text is what changed. In the shadow file, the pacnew (default) does not contain root's password hash which yours does. You don't want to lose that either. wink

Last edited by fsckd (2011-04-14 19:30:57)


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#21 2011-04-14 19:36:53

mcmillan
Member
Registered: 2006-04-06
Posts: 737

Re: [SOLVED]pacnew files? i need help...

It's better to say exactly what you're confused about rather than just saying your confused and asking us to tell you what to do.

Briefly, bash.bashrc is to configure how your bash shell works, it's up to you to configure it how you like, though Arch's defaults are generally good for most people.
shadow is where information about your users is stored, editing it will likely break things
fstab is what defines where your partitions are mounted. I'd suggest reading up about it in general, not just for for dealing with pacnew files, but to understand how your system works. If you understand what is in the file it should be obvious how to deal with fstab.pacnew

Offline

#22 2011-04-15 14:25:37

grobar87
Member
From: Македонија
Registered: 2010-08-25
Posts: 172

Re: [SOLVED]pacnew files? i need help...

@fsckd Thanks. smile
@mcmillan You're right,i must read more about linux in general and understand how my system works.After reading more about this in archwiki and your posts here i think i know now what to do,it's much clear now.
Thanks everyone and sorry for my english.


And... here... we... go!

Offline

#23 2011-08-17 10:19:15

jell
Member
Registered: 2011-01-27
Posts: 3

Re: [SOLVED]pacnew files? i need help...

Will pacdiff help??

Offline

Board footer

Powered by FluxBB