I may have erased my password file with pacdiff. I can't login!

I was trying to fix some issues from the July 2023 update and I was using PACDIFF for the first time. I must have done something wrong because I can no longer login. On boot I get the normal login screen, I enter my password, and it says its wrong. Its not wrong.

So, I tried to CTRL+ALT+F3 like I’ve done in the past but it won’t let me. It always loads the normal login screen.

Now I have booted from a Manjaro USB drive and I opened a terminal and did:

manjaro-chroot -a

Is there an easy way to fix my login? I DO have a recent Timeshift snapshot but I’m not sure how to run Timeshift from my USB media. And, Timeshift always asks for the password.

I realize its the weekend but any help is SUPER appreciated!!!

Inside the chroot environment, issue the following command… :arrow_down:

passwd your-user-name-here

Replace your-username-here by your actual username in the installed system. It will prompt you for a password, but it will not echo the characters on the screen, so make sure you type the correct password. The command will set that password as the one to be used for your account in the installed system.

Given that you’re not telling us which files you edited with pacdiff and that my crystal ball is currently in for its annual maintenance, I cannot give you any other advice at this point. :man_shrugging:

P.S.: The timeshift on the live USB should not normally ask for a password.

1 Like

OMG THANK YOU!! That worked, and it makes perfect sense. I just didn’t know you could do it from a USB drive. But I guess that’s what manjaro-chroot does?

I’m going to restore my system to before I messed it up trying to use pacdiff. I’m gonna guess that I should have SKIPPED all of the files except for pacman.conf ?? I kept hitting “o”

Um, no, timeshift doesn’t use a chroot. A chroot environment is like a sandbox. If you chroot into your system from the live USB, then whatever commands you issue in that window will be executed as if you’re running them directly on the installed system, with one big difference, which is that the kernel in use is always going to be the one on the live USB, and this is something to keep in mind when e.g. rebuilding the initcpios.

As for the pacdiff, there are (arguably) better ways of merging your .pacnew files — and you should at the very least review the changes in the .pacnew — such as meld. :wink:

1 Like

Like what?
I am very tired of this concept being repeated bundled in misunderstanding.

All pacdiff does is present you with the files and prompts to do things with them.
pacdiff is not the manager of the differences or, as they are known, a ‘comparison tool’ in and of itself.
Its the tool for helping you with those files that pacman creates - as part of the pacman package.
If there is an even marginally arguably better tool, I would love to hear what that is.

And no … one should not usually just hit ‘overwrite’ on every pacnew file … nor simply skip every one … in either case then would be the point of them?

The point is to analyze, compare, and merge as is necessary.

In some cases an overwrite is acceptable … in others you must manually compare and edit, and so on.

https://wiki.archlinux.org/title/Pacman/Pacnew_and_Pacsave

1 Like

Hi, I was reading MANY of the responses in:

and I guess I was confused. I’ve used vim before so I already had it installed. I saw someone say you could safely overwrite the file, so that’s what I did… to ALL of the different files pacdiff showed me.

So at least I know not to do that again, lol.

I’m going to use Timeshift to put everything back to earlier this evening and then I’ll try to fix my system again. This time, I’ll SKIP all the files except for pacman.conf and I’ll MERGE that one. Does that sound like a good plan??

Thanks to both of you for your help!!!

In the case of the pacman.conf … if you dont have any manual configurations to preserve it is safe to overwrite. That file cant possibly affect things like login and desktop etc.
But thats for that particular file. Just because it can technically be true for that one in this one instance does not mean anything else for others … or for other instances of even that file.
In this case … the problem was the other ones.
Which you cant simply ignore forever either.
You should investigate them and compare … make changes as needed and remove them, etc.
Its simply part of managing an Arch-based linux system.
Please refer to the wiki link above.

But yeah … sure … if you load your backup, handle the pacman.conf while ignoring the others, then … you should roughly be updated and able to login … but you should still deal with those other files.

1 Like

:arrow_down:

2 Likes

meld does not have the capability to report pacnew files.
thats what pacdiff does …
(you can use any comparison tool with pacdiff)

DIFFPROG=meld pacdiff -s

Or, if one has set their env vars … then … just use pacdiff … and it in turn uses meld.

1 Like

Right now I have an unstable system that was working perfectly before the July update. I certainly understand things need to more forward but right now I have to figure out how to fix my system and I’m not sure where to even start. I figured I would start with the solutions presented in the forum thread and then take it from there.

I’m going to compose a new topic where I list the things that aren’t working but I always try to tinker with things on my own and search for people with similar issues before I post a new thread.

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