Failed to run meld as root

Unless one of the meld programmers is on Manjaro, you’d be better off raising a bug request on their site: you’ll get more pointed answers that way…

If you’re using this meld, use sudo diff instead to compare system files…


P.S. You’re absolutely right about sudo and graphical programs.
P.P.S. If you use that program solely as root then the previous statement is null and void…


1 Like

Thank you very much for your answer! :smile: I’ll try to raise a bug request on their site; and yes I’m using this meld you referred to.

Unfortunately, sudo diff is not practical to me. I need meld as a simple graphical tool to quickly compare and eventually merge .pacnew - files. It is the only thing where I couldn’t find a a good non-graphical alternative.

On the bright side, I use it solely for that indeed. :upside_down_face: As for now, I switched to do this instead:

pacdiff -o
sudo -i
meld /etc/thisandthatfile /etc/thisandthatfile.pacnew
1 Like

I’ve marked the below answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or :heart: or :+1: if you agree)

P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.


Fair enough, and thank you very much! :smiley: I’ll do as you told me! :+1: :upside_down_face:
Kind regards!

meld works without sudo for comparing files in home folder

.pacnew files are usually in system folders and not home so sudo is needed

1 Like

That’s exactly why root privileges are needed to compare, backup, edit and replace these files. :grin:

the .pacnew files are not in home folder
so there is no potential for file permissions to be changed in home folder

My knowledge about this is rather limited, but as far as I know, running a graphical application as sudo might change privileges of potentionally vital configuration files in your home directory.

The target editing file of the application is irrelevant.

Take a close look at the arch wiki article here.

If I thought meld was changing any file on my system (except for the one file I wanted to edit) I would want to find evidence of any changes to report the package as potential malware

meld only needs root privileges for write access to the system file
it could be used for a .pacnew comparison without sudo, but requires some additional steps:

  1. user must click on padlock icon to unlock a system file for editing
  2. the edited file must be saved to a location with user write access
  3. the modified file can be moved to replace the system file with a terminal command

Yes, it’s just that I had around 20 .pacnew-files… this way it would take forever.

This would have been my personal choice as solution, especially if one takes into account what the Title of the OP says combined with what the intended usage was of of the OP’er… :wink:

I generally agree with that, but in some cases it can make sense (like in your case) when you know what your’re doing.

File permission changes:

Well yeah, if you edit files with a sudo’ed program within your home folder this will screw up file permissions. I guess that concern comes from the scenarios where users just blindly sudo everything (“hey I heared about about that sudo which makes you the master. I just prepend all commands with it…”).

However your intention is clearly to make file changes that are owned by root.

Millions of lines of code run with elevated privileges:

Well, that’s true. However as long as your system and network are not already compromised and someone is waiting for you to run GUI as root I don’t see too much of an issue.
Text based programs can also make use of tons of foreign libraries, running millions of lines of code.

So. On a well secured system I don’t think running meld with root permissions (for the purpose of changing root owned files) for 5 minutes is a big issue here.

The alternative is to make your diff analysis via meld and then use a text based editor (with root permissions) to make the desired changes…


Thank you for the detailed explanation.

1 Like

On EndeavourOS forum I saw this cool helper implementation of running meld as root

set -euo pipefail
export PATH=/usr/bin:/usr/sbin

for i in $(/usr/bin/pacdiff --output); do
	echo "Merging $i ..."
	/usr/bin/meld "admin://$i" "admin://${i/.pacnew/}";
1 Like

that looks like it was developed from the script that was on the old forum
A nifty way to deal with pacnew files using sudoedit - General Discussion - Manjaro Linux Forum
that used to work well for me, but i usually deal with them as soon as I see them mentioned in update information now

1 Like

Maybe - creating helpers for handling such files tends to look alike.

This one is using admin: protocol which makes it pretty unique compared to the you linked from the old forum.

1 Like

Wow, great! That is pretty fantastic stuff and very useful, thank you very much for sharing! :smile:

I never heard of that till now :eyes:
Do you have any links i can read about it to educate myself about it?

I don’t know - I can’t remember - but I am fairly certain it is a part of GVFS (Gnome Virtual File System) which is available using the gvfs package.

It works for a lot of apps - most notably GTK based apps e.g.

xed admin:/etc/fstab

I also used it with gedit and thunar.

Using older apps like leafpad on LXDE or geany won’t work - they don’t recognize the protocol.

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