Merged pacnew overwriting a few important files

Hi everyone, I made an oopsie and merged over a few important files and I am trying to manually fix it. I have checked to see if there was a backup file of these couple files, but I cannot find any. The files I wrote over with the pacnew files were:
/etc/hosts
/etc/passwd
/etc/shells
/etc/fwupd/remotes.d/lvfs-testing.conf
/etc/fwupd/remotes.d/lvfs.conf

I am unable to login as my user, when I do the login screen refreshes and I am prompted to repeat the login process. I am able to login to root, but I am unable to identify what I need to change in /etc/shells or /etc/passwd to potentially add back my user.

Thank you for your help!

/etc/passwd is the most critical one here
and it does have a backup file

You can check with:
less /etc/passwd-
or
cat /etc/passwd-
whether all is still there

If it is, you got lucky.

as root:

cp /etc/passwd- /etc/passwd

/etc/passwd- is the backup file

Whenever you change a password, this contains the previous information.

If you have already tried that once - it’s too late …

2 Likes

Yes! That fixed my login issues. Thank you so much! I have tried replacing the backup files a couple times but didn’t try passwd, I was hyper focusing on /etc/shells.

2 Likes

Welcome to the forum! :vulcan_salute:

Please note that to merge does not mean to overwrite. You merge .pacnew files by way of a tool like meld, diffuse or kompare. :wink:

For /etc/passwd, as root, just restore the automatically created backup file… :point_down:

cp /etc/passwd- /etc/passwd

For /etc/shells, this is what it should look like… :point_down:

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

/bin/sh
/bin/bash
/bin/rbash
/bin/zsh
/usr/bin/sh
/usr/bin/bash
/usr/bin/rbash
/usr/bin/zsh
/usr/bin/git-shell

Your /etc/hosts should look something like this… :point_down:

# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1       localhost
# 127.0.1.1       the-name-of-your-computer  | uncomment this is you have this filled in
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

I’m afraid I cannot help you with those. :man_shrugging:

2 Likes

This is great! I am a bit new to Arch, so learning pamac is something I am grappling with. I was using pacdiff to go through each file and yes I meant overwrite, not merge. Thank you for your time!

1 Like

Well, pamac is a Manjaro thing. The Arch-proper package manager is pacman, which is command-line-only. :wink:

As an alternative to pamac — specifically, if you want a graphical package manager — there is also octopi, which generally works better than pamac, although it does not offer support for FlatPaks and Snaps, if you happen to be using those.

:point_down:

For merging your .pacnew files, there are several approaches.

  • Manjaro has a tool for that — with the disclaimer that it’s still under development and may not be perfect — called manjaro-pacnew-checker. It’s in the repositories… :point_down:

    sudo pacman -S manjaro-pacnew-checker
    
  • There is a similar tool in the AUR, called pacnew-chaser. :point_down:

    pamac build pacnew-chaser
    
  • In a terminal window, you can issue the following command… :point_down:

    DIFFPROG=meld pacdiff -s
    

    … which will bring up meld — a graphical side-by-side editor — as the merging tool. :wink:

3 Likes

These fles are provided by fwupd
fwupd/data/remotes.d/lvfs-testing.conf at main · fwupd/fwupd · GitHub
fwupd/data/remotes.d/lvfs.conf at main · fwupd/fwupd · GitHub

1 Like

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