Chose "overwrite" old files with .pacnew - now can't login

Updated on two systems, my laptop and my desktop pc.
First went smoothly.
On the desktop, following the update, I ran pacdiff, it found several .pacnew files.
Since I was in a hurry, and probably I’m anyway too much of a noob to know what to look for manually, I choose to overwrite the old files with the new ones.

Now, on reboot I can’t log into my account anymore, it’s as if the password has changed.
Any suggestions what to do to fix that?

1 Like

Do you remember which files you overwrote?

In the wiki you find the hints what to do with pacnew files. Be aware the the specific customization is always in the old files, so if you find differences you need to determine case by case what to do.

https://wiki.manjaro.org/System_Maintenance
https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave#Managing_.pac*_files

1 Like

For posterity …

https://wiki.manjaro.org/index.php?title=System_Maintenance#Managing_pacnew_and_pacsave_files

Unfortunately, there is no perfect road map for how to deal with these files. If you keep the original config file, and the syntax has changed, the program may stop working or fail to use the existing config. If you remove the original file and use the new file without any changes, all your configuration settings can be overwritten. Sometimes, you need to combine pieces from the new and old files to make everything to work. In these situations it is better to integrate the files manually.

1 Like

@Wollie no, I unfortunately don’t. I was in a hurry and talking to somebody (so I didn’t pay much attention) and just choose to overwrite all of them, as I said, and didn’t backup them either (which I should have, I guess. I assume pacdiff isn’t doing that automatically?) …

The whole thing is fortunately mostly an annoyance (still…), I could always reinstall and copy over the backup, I guess. Of course I wouldn’t mind avoiding that…

The thing is - for noobish users like me, the whole issue is pretty much a gamble.
I certainly didn’t (knowingly) do any manual changes to the affected files and wouldn’t even know what to look for in the first place.

At least now you know it better. Secondly, use timeshift, then you can easily restore your system. I would backup valuable files and reinstall.

…But yes, you did. You manually overwrote them with the pacnews.
The default way the package manager works is by not overwriting files that have changes particular to the system. Thats why a pacnew was created. You then commanded that your files be overwritten by the pacnew files.

1 Like

If you lucky to have livecd with linux (I would say any linux distro) then you can load that livecd, chroot and at first observe the logs to find out what exactly files were changed.

Just for elaborate. Have you tried to log in with root for example?

Quite some people do not take system maintenance seriously and accumulate several pacnew files from several different updates.
If OP is unlucky, /etc/shadow (or rather /etc/shadow.pacnew) was amongst the list.

3 Likes

@cscs
Let me rephrase that: I didn’t do so before overwriting them, so I assumed from the description in the update announcement (and the linked wiki entry) that unless you do so before, you can overwrite them.

@freggel.doe:
Well, it was the first time I heard about that potential issue (I’ve been using Manjaro for some time now) or the necessity of system maintenance beyond making sure updates are running through without any errors.

@webcaptcha
root login doesn’t seem to work either.

only live cd can shed light in your case and help also

chroot you are our only hope:

I think this is exactly that, I remember that pacnew file was recently created and when looking at it I told myself “nope don’t destroy your accounts, delete this pacnew file” :smiley: it had ‘empty’ accounts infos in the pacnew.

edit: here [Stable Update] 2020-06-13 - Kernels, Systemd, Pamac, Cinnamon, Deepin, Firefox, Thunderbird, Qt, Kodi - Stable Updates - Manjaro Linux Forum not so old update

Well, then that is probably what has happened.
Guess I’ll read into how to repair the accounts/passwords. Otherwise I’ll just reinstall, since that will not take that long either and everything after can be running in the background.

Now I’m not specifically blaming anyone here (and I’m not upset about the whole thing) but maybe this whole *.pacnew issue could have been communicated better.
The update announcement made it sound as if replacing is usually the way to go - and anyway it seems rather difficult for non-expert users to determine when to do what.

Why is that happening at all anyway? I’ve never encountered anything similar with other distros (like the Debian based ones).

Also, thank you all for the suggestions so far!

Did you do your system updates via terminal or did you use pamac (gui)?
I do not know if pamac (gui) alerts you to pacnew files, but pacman (terminal) certainly does.
Apparently there is a feature request open for pamac to better alert to pacnew files:

Sometimes new features are added to programs, and new parameters need to be added to the program config file, so in order to not overwrite the user’s config file with the new one, it decides to install the new default config file as .pacnew so the user can check the difference between his config file and the new default one. Most of the time the user just needs to add a few new lines in his old config file, but some other time, like for your accounts config file, this is important to keep it and just add manually the new parameters if needed.
Yes usually you could replace your config files with .pacnew because it is not an issue to reset some configuration to default in most cases, but at the end of the day the user needs to have a look by himself and think about it before doing anything, like for instance the shadow config file containing your accounts info.

1 Like

You get this in certain rolling distros. It’s not just the Arch-based family, but when I update my Sabayon install (Gentoo-based), I’m also told about changes to conf files that I should check on.

Remember fixed release distros like Debian or Fedora have a fixed life, after which you have to install the new version whether as a fresh install or via upgrade path. Doing so cleans up the whole root partition including all the relevant changes to conf files, because new packages and conf files are installed afresh. But for rolling, you have to do your own maintenance and cleanup once in a while because you’re going to be using the same old root partition indefinitely.

I used pacman in terminal.
Of course I didn’t pay much attention there either (also because it kept spamming a warning apparently due to some outdated mirror), since 99% the updates went without any major issues for me so far.
This time it was that 1%, apparently.

if we not use Timeshift :roll_eyes:
is possible to save all config file for .pacnew in archive (any file that can generate a .pacnew file) before merge .pacnew

tar -czf "mybackupSystemConfig.tar.gz" $(LANG=C pacman -Qii|awk '/^MODIFIED/ {print $2}')

LANG=C pacman -Qii|awk '/^MODIFIED/ {print $2}' display all “.pacnew future” , these files are different from the original package

Use a live iso and open a terminal

sudo manjaro-chroot -a

Then check if you have these files

# /etc/shadow-
# /etc/passwd-

These are backups - list their content - they should contain your username

# cat /etc/passwd-
# cat /etc/shadow-

If they contain your username copy them to their original

# cp /etc/shadow- /etc/shadow
# cp /etc/passwd- /etc/passwd

Edit: 2020-09-01T05:40:00Z

Another candidate for verification is

  • /etc/group
5 Likes

Question at @linux-aarhus for repair if no backup exists:
not possible to copy this files from iso to my manjaro, change home in passwd file, boot my manjaro as “manjaro” user and after change user name ?

problem: no exists in this iso file some users “application” (lightdm, sddm, http, …) re-install this apps

1 Like