Continuing the discussion from [Question about passwd.pacnew]

Posting an incorrect path is a simple way to invoke Cunningham’s law
and correct path is shown in @linux-aarhaus quote from 2023

I deleted the pacnew file using the tool:

DIFFPROG=meld pacdiff -s

Glad I came here first to make sure.
This pacnew and pacsave is very confusing at times anda very annoying after big updates…

cool - this will come back at you and bite you
eventually, but : sooner than later :wink:

What do you mean?

… just wait and see
the effect

But I did what was supposed to do.
Not merge and delete the pacnew file…

Everything appear to be fine at the moment.

I don’t think that that was what you where supposed to do.

… which is exactly the same as the outcome of merging the .pacnew
change /bin/bash to /usr/bin/bash

In any case:
you have got to know what you are doing.

My current /etc/passwd/ is in first line:

root:x:0:0::/root:/bin/bash

My /etc/shells file is:

# Pathnames of valid login shells.
# See shells(5) for details.

/bin/sh
/bin/bash
/bin/rbash
/usr/bin/sh
/usr/bin/bash
/usr/bin/rbash

/bin/zsh
/usr/bin/zsh
/usr/bin/git-shell

So what should I do?

Edit your current current /etc/passwd/ file in the first line to:

root:x:0:0::/root:/usr/bin/bash

And you’ll be fine !

You have to use sudo for that, so:
sudo nano /etc/passwd
or
sudo gedit /etc/passwd

It’s not, certainly not with meld anyway. Doing a merge replaces the whole file not just that one single line. Try it yourself - let’s pretend it changed back to /bin/bash;

$ echo 'root:x:0:0::/root:/bin/bash' > passwd.pacnew
$ sudo meld /etc/passwd passwd.pacnew

See the problem? The instructions @Zesko gave are the correct way to deal with this.

I just quickly checked out meld. You realize you can copy specific lines between two sides? Replacing is not merging.

meld can’t do the job in this case -
it will not let you replace that one line from the /etc/passwd.pacnew with the corresponding line in /etc/passwd - it will replace the whole file with that one line
… or I’m too dumb to operate the program

Yes, I see.
But I never said that he was incorrect - and I said “merge” - not “use meld to do it”.

OK, I did what you suggested.

Thanks

Thats not how its supposed to work.
And I’ve certainly used meld to augment passwd.

Are y’all using the ‘merge’ option?
I dont recommend that. The point is usually to use ‘view’ and manually do the ‘merging’.

In this interaction you can replace single lines or single terms, etc.

You can click on the arrows next to the line and selectively merge those strings, etc.

Even if that was somehow broken… you can use the interface to copy/paste or simply write out the first line (etc) if necessary.

… I really dont understand what the issue is.

2 Likes

Try to recreate the situation with the example MrLavender gave.
/etc/passwd contains many lines, the /etc/passwd.pacnew is just one line.
I just installed the program to test it.
I started it like this:
sudo meld /etc/passwd /etc/passwd.pacnew
and upon clicking on the arrow to apply the content of .pacnew (the one line) fom the right side to the original on the left side
the whole original content vanished and only the one line was present. :man_shrugging:

It does work well in other cases, for /etc/mkinitcpio for example.

Le quote.
I mean. If ‘automerge fancy arrow’ doesnt work the way you expect.
Ctrl+z, highlight, Ctrl+c, place cursor position, Ctrl+v.

Same as in all other cases of an editors tools not being perfect.
Using GIMP and the bucket fill doesnt look right?
Then you check your parameters, maybe redraw lines, etc.

The fancy buttons are for convenience … but the biological unit can (usually) be relied upon to be the final arbiter of whether that tool did what it was supposed to do and take proper action.

$ echo 'root:x:0:0::/root:/bin/bash' > passwd.pacnew
$ sudo meld /etc/passwd passwd.pacnew

Yes that’s what I did but it may not be obvious to less experienced users.

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