0

Recovery mode shows a screen that apparently can't find dpkg/apt/any coreutil executables: here, GNOME crashes after login attempt with correct password, systemctl status gdm shows:

Nov 02 16:38:19 (system name) systemd[1]: Starting gdm.service - GNOME Display Manager...
Nov 02 16:38:20 (system name) systemd[1]: Starting gdm.service - GNOME Display Manager.
Nov 02 16:38:20 (system name) gdm-launch-environment] [1005]: pam_env(gdm-launch-environment:session): deprecated reading f user environment enabled
Nov 02 16:38:20 (system name) gdm-launch-environment] [1005]: pam_unix(gdm-launch-environment:session): session opened for user gdm(uid=120) by (uid=0)
Nov 02 16:38:27 (system name) gdm-password] [2135]: (red text)gkr-pam: unable to locate daemon control file(end red text)
Nov 02 16:38:27 (system name) gdm-password] [2135]: gkr-pam: stashed password to try later in open session
Nov 02 16:38:27 (system name) gdm-password] [2135]: pam_env(gdm-password:session): deprecated reading of user environment enabled
Nov 02 16:38:27 (system name) gdm-password] [2135]: pam_unix(gdm-password:session): session open for user (my username)(uid=1000) by (uid=0)
Nov 02 16:38:27 (system name) gdm-password] [2135]: gkr-pam: unlocked login keyring
Nov 02 16:38:27 (system name) gdm-password] [2135]: pam_unix(gdm-password:session): session closed for user (my username)
Nov 02 16:38:27 (system name) gdm3[989]: (bold text)Gdm: GdmDisplay: Session never registered, failing(end bold text)

By coreutils being broken, I mean that all scripts that try to run coreutils fail. It's fine if I type them out, but otherwise not. Also bash(and dash) doesn't recognize built in commands like source and help but does recognize executables such as ls or cd.

Also, running startx does work.

4
  • 1
    Have you somehow overwritten /bin/bash with /bin/dash (or /bin/sh) or a symbolic link to same? That would explain the lack of source and help (which are not dash builtins) and the messages like items[c++]=resume: not found (dash doesn't have arrays) Commented Nov 2, 2023 at 22:25
  • Maybe? I'll try it later. Commented Nov 3, 2023 at 2:07
  • @steeldriver IT WORKED!! Could you upgrade your comment to a full answer so I can mark it as solved? Commented Nov 5, 2023 at 0:09
  • OK so I guess you fixed it by reinstalling the bash package? I have added an answer based on that assumption Commented Nov 5, 2023 at 21:56

1 Answer 1

2

The behavior you're describing suggests that you have overwritten the /bin/bash program with either a copy of, or a symbolic link to, a different shell - most likely /bin/dash (or /bin/sh, which by default is itself a symlink to dash):

  • dash doesn't have a builtin help or source command (the latter is a bash synonym for the POSIX . command)

  • dash doesn't support ksh-style arrays so for example

      $ sh -c 'items[c++]="resume"'
      sh: 1: items[c++]=resume: not found
    

To fix it you will likely need to re-install the bash package - it's been a while since I tried it, but I believe sudo apt install --reinstall bash should work even when bash is currently dash (the package's install scripts invoke bash, but don't actually use any non-POSIX features).

One way this might have happened is if you'd attempted to symlink /bin/sh to bash instead of the default dash, but had got the source and target the wrong way around.

1
  • THANK YOU!! This fixed it for me! Commented Nov 7, 2023 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .