How to use pacdiff on a pacnew file in /usr directory instead of /etc

After updating my system this morning, noticed a warning about a new pacsave file flashing by. Pacdif and Meld in the welcome screen couldn’t find it, but using the grep command here: grep --extended-regexp “.pac(new|save)” /var/log/pacman.log, I was able to locate it, so this is the pair I need to merge: /usr/share/icons/default/index.theme saved as /usr/share/icons/default/index.theme.pacsave.
What command string do I use to access and merge these files?

You could use option -l for pacdiff, but it may give very many .pacsave files.
Alternatively, you can simply use command

sudo meld /usr/share/icons/default/index.theme{,.pacsave}

but I suggest make a backup of both before merging, just in case.

1 Like

It seems that this is an exception from the general packaging rule (create backups for files in /etc/).
Looking at the actual package that creates that file, it looks very simple. It is just a fallback cursor theme.
You should not edit files in /usr/ in any way. In this case, configure your cursor theme locally (in $HOME folder), using some relevant GUI utility.

$ pacman -Qo /usr/share/icons/default/index.theme                                                                                                                            
/usr/share/icons/default/index.theme is owned by libxcursor 1.2.1-2

$ cat /usr/share/icons/default/index.theme                                                                                                                                
[Icon Theme]
Inherits=Adwaita
2 Likes

The output from “pacman -Qo /usr/share/icons/default/index.theme” is:
error: No package owns /usr/share/icons/default/index.theme

So the cat command as shown, will accomplish the merge?

I might just ignore this. I can’t even find the file that was ‘replaced’.

If I type them both in with their path, the computer sees the pacsave file, and since I didn’t use SUDO it just gives a permission error. The original file, it has no idea about:

[mark@mark-optiplex9020 ~]$ /usr/share/icons/default/index.theme.pacsave
bash: /usr/share/icons/default/index.theme.pacsave: Permission denied
[mark@mark-optiplex9020 ~]$ /usr/share/icons/default/index.theme
bash: /usr/share/icons/default/index.theme: No such file or directory
[mark@mark-optiplex9020 ~]$

I tried using nautilus as it has a file search, no dice there either.

Will

find / -regextype posix-extended -regex ".+\.pac(new|save)" 2> /dev/null

produce any output?

1 Like

Here are the results, you can see that through the month of July I was unaware of pacsave and pacnew files as I had just moved to Endeavor OS so timeshift still has them. I learned later about pacdiff and meld. The original file I’m looking for is still nowhere to be seen. Weird.

[mark@mark-optiplex9020 ~]$ find / -regextype posix-extended -regex “.+.pac(new|save)” 2> /dev/null
/home/mark/index.theme.pacsave
/timeshift/snapshots/2022-07-29_14-09-14/localhost/etc/pacman.d/mirrorlist.pacnew
/timeshift/snapshots/2022-07-09_10-55-04/localhost/etc/pacman.d/mirrorlist.pacnew
/timeshift/snapshots/2022-12-02_11-26-08/localhost/usr/share/icons/default/index.theme.pacsave
/timeshift/snapshots/2022-07-09_21-50-30/localhost/etc/pacman.d/mirrorlist.pacnew
/timeshift/snapshots/2022-07-25_11-40-25/localhost/etc/pacman.d/mirrorlist.pacnew
/timeshift/snapshots/2022-07-10_21-22-47/localhost/etc/pacman.d/mirrorlist.pacnew
/timeshift/snapshots/2022-07-16_19-51-15/localhost/etc/pacman.d/mirrorlist.pacnew
/timeshift/snapshots/2022-07-14_19-45-56/localhost/etc/pacman.d/mirrorlist.pacnew
/usr/share/icons/default/index.theme.pacsave
[mark@mark-optiplex9020 ~]$

1 Like

A pacsave file is basically a backup configuration file that’s created when certain packages are removed/deleted.

It looks to me like you might have removed/deleted a theme that had been in use, and the pacsave file is the backup of a file related to the use of that theme. If you deleted the theme, merging the pacsave into a current config file would make no sense.

2 Likes

Bingo. I did, but in a different place. It was a week ago, and I didn’t connect this to that. I did seek help with it.

Not sure what I do about it now though.

1 Like

Ignore it. If the theme no longer exists (or no longer exists in the original location), you obviously don’t want to use that theme - so the pacsave is worthless to you. You can safely delete it.

2 Likes

Update the package database :

sudo pacman -Fy

Once it’s updated, you can search for your file :

pacman -F /usr/share/icons/default/index.theme

If there’s no answer, you know that, at least, this file don’t belong to any official package. You can remove the file safely.

2 Likes

Well, I’ve already deleted the file, rebooted the machine and no ill effects so far… I did backup a copy of the file to my desktop should I still need it.

Did the update, ran the pacman command.

[mark@mark-optiplex9020 ~]$ sudo pacman -Fy
[sudo] password for mark:
:: Synchronizing package databases…
endeavouros 297.9 KiB 204 KiB/s 00:01 [--------------------------------] 100%
core 1016.1 KiB 526 KiB/s 00:02 [--------------------------------] 100%
extra 10.3 MiB 7.07 MiB/s 00:01 [--------------------------------] 100%
community 28.0 MiB 4.86 MiB/s 00:06 [--------------------------------] 100%
multilib 244.1 KiB 202 KiB/s 00:01 [--------------------------------] 100%
[mark@mark-optiplex9020 ~]$ pacman -F /usr/share/icons/default/index.theme
[mark@mark-optiplex9020 ~]$

Didn’t find it’s so it’s been resolved I guess…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.