Cut off to manjaro after changing etc/passwd

I’ve changed passwd.pacnew to passwd, now i cannot log in to manjaro anymore. Any suggestions?

You will need to boot from a Live USB, chroot in, then set new passwords for your user(s) (and root if you set a password for that).

manjaro-chroot -a
passwd <yourusername>

… etc. Then exit chroot & reboot.

Note: I made the same mistake (blindly merging the file) a good while back. The above method fixed the issue.

I suspect there are more pacnew files you need to deal with?

pacdiff -o
2 Likes

Hi @anon58427774,

This is why you should always read the announcements, there was a mention of how to handle that file.
This is also a good example of why you should never blindly overwrite a file. Especially system files. That file contain your user, it’s id, and more. So replacing it esentially removed your username.

Your options are:

  1. Restore the file from a backup;
  2. try to chroot into your PC and reset your root user’s password and recreate your user with temporary home directory.
    2.1. Set the home directory and it’s contents owner and group to the new user’s username and group.
    2.2. Set the home directory and it’s contents uid and gid to the newly created one’s, if this hasn’t automatically been done with the previous step.
    2.3. Pray for the best and reboot. I don’t have any more precise info.
  3. Enter a chroot environment and see if there is a backup /etc/passwd, usually /etc/passwd-, and if it, replace the faulty one with that.
  4. Don’t do it again.

Hope this helps!

1 Like

For future reference, pacnew files generally need merged into your existing file, not used as a straight replacement. But maybe you already know that and just slipped up this time.

1 Like

Exactly! I’m usually more careful. :facepalm: Easily fixed, though. :sweat_smile:

This was likely around the time Plasma6 landed in Stable, so quite a while ago.

1 Like

I’ve managed to chroot from the live usb, then changed the root and added back my user. Everything works ad before.
But i’m really, really fed up with linux in general. I use it from 2017 but i’m seriously considering to quit for good.
I just want a secure environment to browse and listen to music, without the hassle of antivirus or windows bloatware.
Cleary linux is not suited for me, there are too much things to do, and i don’t have the patience to look after them all. It’s an OS made for developers and only them.
From now i won’t make any edit to the system, not even the updates. I’m done for.
I’m on a dual boot with win 10, i didn’t upgrade to win11 out of fear that it will erase manjaro, but on october i will upgrade nonetheless, and what happens, happens. I won’t reinstall any linux distro for sure. I’m not an ICT engineer and i don’t want to become one.

If you don’t want to spend time on regular maintenance, you don’t want a rolling-release. From your description, I’d recommend you use an Ubuntu LTS version.

Nope. It is an OS requiring you to think, roll up your sleeves and get your hands dirty.

But it’s (quite obviously) not everyone’s cup of coffee, and I’ve heard that’s OK. Some people prefer tea and you can’t force 'em to be right.

2 Likes

Security gaps are then no longer being patched…

1 Like

What you describe/want is something like Ubuntu, a Point Release distribution. Manjaro being a Rolling Release, obviously the user needs to be involved, it is the nature of the beast.

3 Likes

I used ubuntu for two years, from 2017 to 2019, but i ditched it because even basic packages like audio players were vastly outdated and sometimes bugged. Only way was to add a ppa, but after a while they conflicted with themselves.
Lots of software weren’t available as well, and often the updates from one version to another killed the distro.
I switched to manjaro because it’s fairly simple to use and a lot of software is available. I learned about the .pacnew files today, basically.
Anyway, i will try to do what i can, my distro hopping days are way over. Then, we will see.

1 Like

Regarding .pacnew files, what I’d suggest with any you’re unsure of, is to post the original and the .pacnew in a Support topic; that way we can advise on what to do with them.

I think these are the biggest “tripping-point” for users not familiar; there is also no easy way to “automate” the process due to the reason for their existence: to not overwrite users’ changes during updates.

As already mentioned, check the relevant update announcement thread before making such changes, and if unsure, just ask! :wink:

2 Likes

Ok, thanks!

I also changed locale.conf or something like that. After the last update, everything is messed up.
STOP. I’M DONE FOR. I’m going back to windows. now.

Thanks for informing us about your tantrum. Farewell, wish you luck.

1 Like

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