Find and merge the .pacnew files an upgrade left behind
The problem and the find/grep commands are fine, but the pacdiff invocation is broken as written. sudo DIFFPROG=nvim -E pacdiff fails: sudo stops option parsing at the VAR=value assignment, so -E is taken as the command to execute ('sudo: -E: command not found'). Separately, pacdiff(8) documents the default DIFFPROG as vim -d (or nvim -d when EDITOR=nvim), so bare nvim opens two buffers rather than a diff, and modern pacdiff has a --sudo flag that is the intended way to run it unprivileged. The suggested pacdiff-pacman-hook-git AUR package could not be verified and should not be recommended blind.
Never blanket-mv *.pacnew over the live files. Overwriting /etc/passwd, /etc/shadow, /etc/group, /etc/fstab or /etc/sudoers with a .pacnew will lock you out of your account, out of sudo, or make the system unbootable. Always diff each file individually.
Symptom
Update output scrolls past lines like:
warning: /etc/pacman.conf installed as /etc/pacman.conf.pacnew
warning: /etc/ssh/sshd_config installed as /etc/ssh/sshd_config.pacnew
Weeks later something breaks for no obvious reason: sshd refuses to start, sudo behaves oddly, a service silently uses stale defaults.
Cause
When a package ships a new version of a config file you have modified, pacman refuses to overwrite it and drops the new version alongside as .pacnew. Nothing merges it for you. Over time your live config drifts behind upstream defaults and eventually contains directives the new binary no longer understands.
Fix
Find every outstanding file:
sudo find /etc -name '*.pacnew' -o -name '*.pacsave'
Merge them interactively with pacdiff from pacman-contrib. pacdiff's default DIFFPROG is already vim -d (nvim -d when EDITOR=nvim), so run it as your normal user and let it elevate only where it needs to:
sudo pacman -S --needed pacman-contrib
pacdiff --sudo
With an explicit diff tool. Note the -d, because a bare nvim opens two buffers instead of a diff:
DIFFPROG='nvim -d' pacdiff --sudo
# or, if your pacdiff predates --sudo:
DIFFPROG=meld sudo -E pacdiff
Do NOT use sudo DIFFPROG=nvim -E pacdiff, because sudo stops parsing options at the VAR=value assignment and then tries to run -E as the command.
pacdiff shows each pair and offers view / merge / keep-old / use-new / remove. To review history of everything that ever produced one:
grep -E '\.pacnew|\.pacsave' /var/log/pacman.log | tail -20
Make it a habit: run pacdiff --sudo after every upgrade.
Verify
sudo find /etc -name '*.pacnew' returns nothing, and affected services restart cleanly (systemctl restart sshd && systemctl status sshd).