How to resolve /etc/makepkg.conf.pacnew

Hello,

I have a /etc/makepkg.conf.pacnew and reading about this it seems to be that:

  • For some reason I had edited my /etc/makepkg.conf and modified it
  • An update to pacman created the .pacnew file in order not to overwrite my changes

The problem is, I don’t recall ever changing the file or why I might’ve done it.

Is it generally “safe” to just overwrite the file with newest version?

Here is the diff:

user@host /etc> diff makepkg.conf makepkg.conf.pacnew 
1a2,3
> # shellcheck disable=2034
> 
26c28
< VCSCLIENTS=('bzr::bzr'
---
> VCSCLIENTS=('bzr::breezy'
42,43c44,46
<         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
<         -fstack-clash-protection -fcf-protection"
---
>         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
>         -fstack-clash-protection -fcf-protection \
>         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer"
45c48,49
< LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
---
> LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
>          -Wl,-z,pack-relative-relocs"
47c51
< #RUSTFLAGS="-C opt-level=2"
---
> RUSTFLAGS="-Cforce-frame-pointers=yes"
49c53
< MAKEFLAGS="-j6"
---
> #MAKEFLAGS="-j2"
53c57
< #DEBUG_RUSTFLAGS="-C debuginfo=2"
---
> DEBUG_RUSTFLAGS="-C debuginfo=2"
82c86
< # Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto)
---
> # Makepkg defaults: OPTIONS=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug !lto !autodeps)
93a98
> #-- autodeps:   Automatically add depends/provides
95c100
< OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug !lto)
---
> OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto)
112a118,119
> #-- Prefix and directories for library autodeps
> LIB_DIRS=('lib:usr/lib' 'lib32:usr/lib32')
140c147
< COMPRESSZST=(zstd -c -z -q -)
---
> COMPRESSZST=(zstd -c -T0 --ultra -20 -)
159a167
> # vim: set ft=sh ts=2 sw=2 et:

If you didn’t edit the file manually or don’t remember doing so, it is likely that you didn’t. This happens at times. You can view the differences between files using pacdiff.

https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave#pacdiff

Example:

➤ sudo pacdiff -f
[sudo] password for username:          
==> pacnew file found for /etc/default/grub
:: (V)iew, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/m/s/r/o/q]

This will show you all the files with “conflicts”. Notice you have the option to do whatever you want here, but make sure to read through carefully before making any changes.

I imagine makepgk.conf is not a file to make mistakes with.

It is not so much about safety as about if it is desirable to do so.

There is a reason why a .pacnew is created and that is if the user has done any modifiaction to a config file.

If they want to keep that modification, so I would say that it is not desirable to overwrite the file.

But is it safe? Well, apart from loosing the modification and thereby some functionality, it won’t break the system.

1 Like

Looking at the diff I think the above may be what I edited. I don’t recall it, but it would make sense (the system is a 5950X).

I will just overwrite the file with the new one and adjust the number of jobs again.

1 Like

I would probably keep your existing in this case.

However, if you want to merge it, you should probably change debug to !debug in OPTIONS=

2 Likes