You are not logged in.

#51 2025-04-29 10:35:20

dratos97391
Member
Registered: 2016-08-04
Posts: 49

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

Hi, after some time off I started digging into this again.

I chrooted and retried to install all packages just to arrive at the same faults again. Then I decided to check only one package, ufw.

So, Ufw had this before;

ufw: 76 total files, 2 altered files

Doing a pacman -S ufw

and then

pacman  -Qkk | grep -v ', 0 altered files' | grep ufw

gives me:

warning: ufw: /etc/ufw/before.rules (Permissions mismatch)
ufw: 76 total files, 1 altered file

a second reinstall gives me the same result.

I tried the same with util-linux that has:

util-linux: 1271 total files, 4 altered files

warning: util-linux: /etc/pam.d/remote (File type mismatch)
warning: util-linux: /etc/pam.d/runuser (File type mismatch)
warning: util-linux: /etc/pam.d/su (File type mismatch)
warning: util-linux: /etc/pam.d/su-l (File type mismatch)

it had the following errors when installing:
error: extract: not overwriting dir with file /etc/pam.d/runuser

so I deleted the folder and tried again, and now I get:

# pacman -Qkk util-linux
warning: util-linux: /etc/pam.d/remote (File type mismatch)
warning: util-linux: /etc/pam.d/su (File type mismatch)
warning: util-linux: /etc/pam.d/su-l (File type mismatch)
util-linux: 1271 total files, 3 altered files

reinstalling multiple times gives the same result.

Last edited by dratos97391 (2025-04-29 10:36:38)

Offline

#52 2025-04-29 20:12:35

seth
Member
Registered: 2012-09-03
Posts: 63,354

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

sudo ls -l /etc/pam.d

Online

#53 2025-04-29 20:31:55

dratos97391
Member
Registered: 2016-08-04
Posts: 49

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

# ls -l /etc/pam.d
total 120
-rw-r--r-- 1 root root  234 Mar 29 14:22 chfn
-rw-r--r-- 1 root root  103 Mar 20 14:22 chpasswd
-rw-r--r-- 1 root root  234 Mar 29 14:22 chsh
-rw-r--r-- 1 root root  103 Mar 20 14:22 groupmems
-rw-r--r-- 1 root root  222 Mar 29 14:22 login
-rw-r--r-- 1 root root  103 Mar 20 14:22 newusers
-rw-r--r-- 1 root root  274 Aug 15  2024 other
-rw-r--r-- 1 root root   97 Mar 20 14:22 passwd
lrwxrwxrwx 1 root root   63 Feb 13 19:09 remote -> ../../../usr/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf
-rw-r--r-- 1 root root  267 Mar 29 14:22 remote.pacnew
drwxr-xr-x 2 root root 4096 Nov 18  2015 rlogin
-rw-r--r-- 1 root root  425 Apr 15 16:57 rsh
-rw-r--r-- 1 root root   86 Mar 29 14:22 runuser
-rw-r--r-- 1 root root   86 Mar 29 14:22 runuser-l
-rw-r--r-- 1 root root   87 Apr 17 19:52 samba
-rw-r--r-- 1 root root  234 Dec 18  2023 sshd
-rw-r--r-- 1 root root  171 Apr  9 16:09 sshd.pacnew
lrwxrwxrwx 1 root root   61 Nov 24 16:28 su -> ../../ca-certificates/extracted/cadir/emSign_Root_CA_-_C1.pem
lrwxrwxrwx 1 root root   61 Nov 24 16:28 su-l -> ../../ca-certificates/extracted/cadir/emSign_Root_CA_-_G1.pem
-rw-r--r-- 1 root root  500 Mar 29 14:22 su-l.pacnew
-rw-r--r-- 1 root root  500 Mar 29 14:22 su.pacnew
-rw-r--r-- 1 root root   97 Nov 30 14:54 sudo
-rw-r--r-- 1 root root 1317 Aug 15  2024 system-auth
-rw-r--r-- 1 root root  143 Aug 15  2024 system-local-login
lrwxrwxrwx 1 root root   30 Feb 14 13:09 system-login -> /usr/lib/cifs-utils/idmapwb.so
-rw-r--r-- 1 root root  607 Aug 15  2024 system-login.pacnew
-rw-r--r-- 1 root root   28 Sep 24  2024 system-remote-login
-rw-r--r-- 1 root root  143 Aug 15  2024 system-remote-login.pacnew
-rw-r--r-- 1 root root  260 Aug 15  2024 system-services
-rw-r--r-- 1 root root  131 Apr 18 20:42 systemd-user
-rw-r--r-- 1 root root  124 Feb 19 21:17 vlock

I also tried to reinstall all packages in the file "a"
a:
http://0x0.st/8WUZ.txt

and got this file
b:
http://0x0.st/8WUa.txt
which is smaller with only 37 packages but still not empty

this was the script I used

#!/bin/bash

# Read the file line by line
while IFS= read -r line; do
    # Extract the package name before the colon
    package_name=$(echo "$line" | awk -F: '{print $1}')
    
    # Run the pacman command with the package name
    if [ -n "$package_name" ]; then
        pacman -S --noconfirm "$package_name"
    fi
done < a

my last journalctl shows some irregulartieis when trying to login: http://0x0.st/8WUA.txt
so looks like some login related files got corrupted during this mishap.

Last edited by dratos97391 (2025-04-29 20:39:42)

Offline

#54 2025-04-29 20:43:13

seth
Member
Registered: 2012-09-03
Posts: 63,354

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

lrwxrwxrwx 1 root root   63 Feb 13 19:09 remote -> ../../../usr/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf
drwxr-xr-x 2 root root 4096 Nov 18  2015 rlogin
lrwxrwxrwx 1 root root   61 Nov 24 16:28 su -> ../../ca-certificates/extracted/cadir/emSign_Root_CA_-_C1.pem
lrwxrwxrwx 1 root root   61 Nov 24 16:28 su-l -> ../../ca-certificates/extracted/cadir/emSign_Root_CA_-_G1.pem
lrwxrwxrwx 1 root root   30 Feb 14 13:09 system-login -> /usr/lib/cifs-utils/idmapwb.so

The directoy and symlinks are clearly bogus, the garbage system-login is a critical problem.
Restore them w/ the *.pacnew's, re-install inetutils (for rlogin, check its contents and delete or move it before re-installing inetutils)

Check the sanity of sshd and system-remote-login

Online

#55 2025-04-29 21:33:41

dratos97391
Member
Registered: 2016-08-04
Posts: 49

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

seth wrote:
lrwxrwxrwx 1 root root   63 Feb 13 19:09 remote -> ../../../usr/lib/systemd/ssh_config.d/20-systemd-ssh-proxy.conf
drwxr-xr-x 2 root root 4096 Nov 18  2015 rlogin
lrwxrwxrwx 1 root root   61 Nov 24 16:28 su -> ../../ca-certificates/extracted/cadir/emSign_Root_CA_-_C1.pem
lrwxrwxrwx 1 root root   61 Nov 24 16:28 su-l -> ../../ca-certificates/extracted/cadir/emSign_Root_CA_-_G1.pem
lrwxrwxrwx 1 root root   30 Feb 14 13:09 system-login -> /usr/lib/cifs-utils/idmapwb.so

The directoy and symlinks are clearly bogus, the garbage system-login is a critical problem.
Restore them w/ the *.pacnew's, re-install inetutils (for rlogin, check its contents and delete or move it before re-installing inetutils)

Check the sanity of sshd and system-remote-login


Ok, I did it, but was thrown in an emergyshell, entering the system just got me back to the shell, the reason was that my external disk wasnt plugged in, which is fine but booting anyways failed, here is the journald: http://0x0.st/8WUW.txt

on a sidenote, some packages like rsync also contains these weird symlinks instead of files:

# ls -l /etc/rsyncd.conf*
lrwxrwxrwx 1 root root  64 Nov 24 16:28 /etc/rsyncd.conf -> ../../ca-certificates/extracted/cadir/AffirmTrust_Commercial.pem
-rw-r--r-- 1 root root 172 Feb  2 10:41 /etc/rsyncd.conf.pacnew

Do you know why this might have occured? It seems a random-ish disc crash shouldnt convert all pacnew:ed files to random but valid symlinks.

And to fix this im thinking to just write a script that fixes the obvious cases.

Another even stranger example is the folder:
/usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/src/Driver/IBMDB2/Exception/Factory.php

that used to be a php file, it contains some config and resume file related to transmission:

Factory.php]# ls
02bcc5588759b6da78d027d381a49602623ef52c.resume   9add895e4440a08c0e2fa72fe534dc5856137541.resume
08794e90e4db1f668177be95c3edea0cc7d8b62f.resume   9d4c7431606f7340e3ef78c0bc9c5afedfdd1f3d.resume
0f1c4824e19c04bda94821e410493f439173762a.resume   9dbe222ad060e51e6fbcef170d89fc33dab4c399.resume
1854543b00e32d95bd093f433f7fb3dd7ed9a8a3.resume   a628333c0aa9b2b2cc261b0af42979c935ba64d3.resume
28e9035b1c408382f437a88c45bac30373f5f93d.resume   ad64782018cabdcedafc36322d45dcb62c0b7d6a.resume
2c4649cdddcbafee4e17e7e76f2dc6eb649a5ad2.resume   b8d96779b70f977af6bf270dd2e159b02cc63172.resume
2cfbf8540945e110ccf3573031b891fc312d61fa.resume   b919c7aca9eb9a4a4721fd766226275692069a3f.resume
2d40c5154a12f396c1eabb2cfff8a12faa8cea8a.resume   bandwidth-groups.json
stats.json
....

inspecting a file, like stats.json shows its identical to stats.json residing in
cd /home/dratos/.config/transmission-daemon/

Offline

#56 2025-04-30 06:32:00

seth
Member
Registered: 2012-09-03
Posts: 63,354

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

It seems a random-ish disc crash shouldnt convert all pacnew:ed files to random but valid symlinks.

Bad inode reconstruction - I can see how that has happened.

Apr 29 21:01:47 grex systemd-udevd[333]: /usr/lib/systemd/network/80-container-vz.link:0: Error while reading configuration file: Is a directory
Apr 29 21:01:48 grex (acklight)[364]: systemd-backlight@backlight:acpi_video0.service: Failed to set up special execution directory in /var/lib: Not a directory
Apr 29 21:03:13 grex systemd[1]: Dependency failed for /media/extd1.
Apr 29 21:03:13 grex systemd[1]: Dependency failed for /srv/nfs4/grex/public.
Apr 29 21:03:13 grex systemd[1]: Dependency failed for Local File Systems.

/var/lib not being a directory is a problem (root:root/755) - the other thing breaks your network, comment those (remote) entries in your fstab to get over that for the moment.

pacman -Qkk |& grep 'File type mismatch'

Online

#57 2025-05-01 18:54:40

dratos97391
Member
Registered: 2016-08-04
Posts: 49

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

I went through all the files with pacman -Qkk warnings except UID/GID and permission problems and tried to re-install them.

First I went through the ones with a pacnew file, replacing the original with pacnew


This script finds mismatched files and shows me the diffs for inspections so I can replace them with pacnew's.

# Read the input file line by line
while IFS= read -r line; do
        # Check if the line contains "File type mismatch"
        if [[ "$line" == *"File type mismatch"* ]]; then
                # Extract the file path from the line
                file_path=$(echo "$line" | awk '{print $3}')
                echo $file_path

        # Construct the .pacnew file path
        pacnew_file="${file_path}.pacnew"

        # Check if the .pacnew file exists
        if [ -f "$pacnew_file" ]; then
                # Show the differences between the original file and the .pacnew file
                echo "Differences between $file_path and $pacnew_file"
                echo "" >> diffs 
                echo "" >> diffs
                echo "" >> diffs
                echo "$file_path" >> diffs
                if [ -f "$file_path" ]; then
                        diff "$file_path" "$pacnew_file" >> diffs
                else 
                        echo "Warning: $file_path is not a file." >> diffs
                fi
            echo rm -r "$file_path"  >> files
            echo mv "$pacnew_file" "$file_path"  >> files
            
        else
            echo "Warning: $pacnew_file does not exist."
        fi
    fi
done < "$1"

by executing files.

I also reinstalled the packges with corrupt files with this program, that I had to run a few times:

while IFS= read -r line; do
    # Extract the package name before the colon
    package_name=$(echo "$line" | awk -F: '{print $1}')
    
    # Run the pacman command with the package name
    if [ -n "$package_name" ]; then
        pacman -S --noconfirm "$package_name" 2>> x_errs
        echo $package_name
    fi
done

lead me to delete these files since pacman could not reinstall them due to different errors.

rm -r /etc/avahi/avahi-daemon.conf
rm -r /usr/share/locale/ar/LC_MESSAGES/avahi.mo
rm -r /etc/containers/policy.json
rm -r /etc/containers/seccomp.json
rm -r /usr/share/containers/storage.conf
rm -r /usr/bin/escapesrc
rm -r /usr/share/doc/libthai/html/tab_h.png
rm -r /usr/share/doc/libthai/html/tabs.css
rm -r /usr/share/doc/libthai/html/thbrk_8h.html
rm -r /etc/lvm/profile/lvmdbusd.profile
rm -r /etc/lvm/profile/metadata_profile_template.profile
rm -r /etc/lvm/profile/thin-generic.profile
rm -r /etc/lvm/profile/thin-performance.profile
rm -r /etc/lvm/profile/vdo-small.profile
rm -r /etc/lynx.cfg
rm -r /etc/lynx.lss
rm -r /usr/share/locale/gu/LC_MESSAGES/p11-kit.mo
rm -r /etc/profile.d/perlbin.sh
rm -r /usr/bin/phar
rm -r /usr/bin/phpize
rm -r /usr/share/doc/podman-compose/examples/nodeproj/example.local.env
rm -r /usr/share/doc/podman-compose/examples/nodeproj/package.json
rm -r /etc/udev/iocost.conf
rm -r /usr/lib/systemd/network/80-container-vb.link
rm -r /usr/lib/systemd/network/80-container-vz.link
rm -r /usr/include/pytalloc.h

so I could reinstall

Unfortunatley some files, like /etc/webapps/nextcloud/config/config.php got overwritten with defaults, it should be in my backups though.

I can boot into my user but there is an issue, its not only files watched by pacmans packages that are randomly assigned with others, its a lot of files here and there so the system is kinda fucked anyways.

There are almost no pacman -Qkk errors but non pacman files, like motd are replaced with random things like PGP certificates. I guess there is no going back so I'm kinda posting my attempts for future people who googles and finds their way here.

Any opinion, seth on what to do for a person not to get to this system state?

Last edited by dratos97391 (2025-05-01 18:56:13)

Offline

#58 2025-05-01 20:16:19

seth
Member
Registered: 2012-09-03
Posts: 63,354

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

I can boot into my user but there is an issue, its not only files watched by pacmans packages that are randomly assigned with others, its a lot of files here and there so the system is kinda fucked anyways.

it should be in my backups though

Hopfully not only "should" …

This kind of massive FS corruption I can only imagine to be the result of an improper filesystem reconstruction (ie. the FS was severely corrupted and fsck reconstructed the wrong inodes)

I think I got a harddrive error and some systemd processes failed due to missing libraries.
I tried to update and started getting failed to commit.

If the drive is indeed producing IO errors, writing operations ("I tried to update" will most likely still have downloaded a lot of packages?) is never a good choice.
You want to secure/backup all valuable data (everything you cannot just download from the internet again), then assert the health status of the drive resp. fix the IO errors (eg. if it's the bus, not the drive) and the filesystem integrity before continuing to use it.

Overly aggressive trimming on SSDs can get you into trouble even on a healthy drive and of course avoid hard shutdowns as much as possible (not only since the FS won't be synced, if the disk has an internal volatile cache and you cut the power, the cache cannot be written and the FS journal isn't even aware that this hasn't happened - and for spinners you stand a chance to scratch the read-write head on the discs, makes a rather ugly noise…)

Online

#59 2025-05-02 16:44:44

dratos97391
Member
Registered: 2016-08-04
Posts: 49

Re: [SOLVED] pacman says: failed to commit transaction (conflicting files)

I will mark the thread as closed, the conclusion is that the original error was caused due to internal pacman files being missing/corrupted. Thanks for the help seth, I will go ahead and continue my backup procedures.

Offline

Board footer

Powered by FluxBB