You are not logged in.

#1 2025-08-03 15:07:39

drslmr
Member
Registered: 2011-05-14
Posts: 63

Find configuration differences to view

There are quite a few specific configuration settings e.g. under "/etc".
I wonder if there is a tool that helps finding changes in my installation with respect to the configuration within the packages?

I did this semi-manually in the following way for example for /etc/pam.d:

As normal user, change to the directory /etc/pam.d as root and run:

for f in *; do pacman -Qo $f; done

Put the result into a file named, for this example "~/pam-pkgs.txt".

Create a directory to store the original configuration files, change to that directory and run:

for p in $(cat ~/pam-pkgs.txt | sed 's/.*is owned by//' | sort | uniq | awk '{ print $1 "-" $2 }') ; do tar --zstd -xf  /var/cache/pacman/pkg/$p*.pkg.tar.zst etc; done

Change to the etc in the new directory and run as root:

for f in $(find -type f); do diff --brief $f /etc/$f; done

This produces a list of files that differ with respect to the packages content.

These files can then be compared e.g. with vimdiff.

I guess there is a toll out there that already does all that?

Offline

#2 2025-08-03 20:42:05

jonno2002
Member
Registered: 2016-11-21
Posts: 851

Re: Find configuration differences to view

this gives just the paths:

sudo pacman -Qkk|grep -ioP "/etc/.+(?= \(SHA256)">paths

this gives package names and paths:

sudo pacman -Qkk|grep -ioP "(?<=backup file: ).+/etc/.+(?= \(SHA256)">names_and_paths

lists the files in /etc that are owned by a package and differ from default

Last edited by jonno2002 (2025-08-03 20:43:07)

Offline

#3 2025-08-03 23:55:56

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,147

Re: Find configuration differences to view

Pacman already has such a mechanism, If they are files that are part of the package and they are listed as backup in the pkg, you'll automatically get pacnew files for the files in question if yours differ from the package, which you can check and query with pacdiff. https://wiki.archlinux.org/title/Pacman … nd_Pacsave -- pacman will notify you when it creates these during an update

Offline

#4 2025-08-04 00:37:31

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,724

Re: Find configuration differences to view

V1del wrote:

you'll automatically get pacnew files for the files in question if yours differ from the package

If yours differs *AND* it changed in the package. I don't think that's what they're looking for.

Offline

#5 2025-08-04 08:29:39

drslmr
Member
Registered: 2011-05-14
Posts: 63

Re: Find configuration differences to view

Thanks for the hints. I think it is more difficult than I thought. Because my approach does not show files added in /etc with respect to the original packages content. I guess I should have tracked the changes I did in a separate git repository.

Offline

#6 2025-08-04 15:12:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,198

Re: Find configuration differences to view

grep -E '^etc/' /var/lib/pacman/local/*/files

will get you a list of all pacman controlled files in /etc
Every file under /etc not listed there is foreign (might be created by an install hook, but still)
As suggested by jonno2002, pacman -Qkk will get you a list of deviating files, but for the actual difference you'll have to fetch the original file from the package.

Online

#7 2025-08-04 17:26:06

drslmr
Member
Registered: 2011-05-14
Posts: 63

Re: Find configuration differences to view

@seth
Ah that's easy.
Thanks.

Offline

#8 2025-08-04 19:54:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,198

Re: Find configuration differences to view

Fwwi, you can also "pacman -Qlq"

Online

Board footer

Powered by FluxBB