This question already has an answer here:

When I try to run a new bash instance [egg@localhost ~]$ bash

I receive id: cannot find name for group ID 999

In /etc/group there is no group with that Id #. Where is this ID being referenced from?

marked as duplicate by Scott, Rui F Ribeiro, Stephen Rauch, cas, Anthon Jul 31 '17 at 8:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Looks like something in your bash startup scripts is calling id; what do you get if you type id? – Jeff Schaller Apr 2 '17 at 3:18
  • uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r – Rice Apr 2 '17 at 3:34
  • Why does that look like output from the root user instead of the "egg" user? – Jeff Schaller Apr 2 '17 at 3:35
  • @JeffSchaller ahh yes, I ran it by accident as root uid=1000(egg) gid=999 groups=999,1000(seqw) context=unconfined_u: where do I change that gid 999? – Rice Apr 2 '17 at 3:40

It looks like you created the user egg with uid 1000 and assigned group id 999 to it, but somehow the name of the group has not been written to /etc/group. Maybe the group egg should have id 999 instead? That's the convention, anyway.

  • there is no group named egg in my system anymore but before there was. Right now the user name is egg and the group no longer exists – Rice Apr 3 '17 at 0:49
  • 1
    Run grep egg /etc/passwd and I bet it says something like egg:x:1000:999:Egg:/bin/bash. The 999 is the primary group id associated with the user egg. Bash complains because the group is missing in /etc/group. – Johan Myréen Apr 3 '17 at 6:50

Something in your bash startup files is calling id -gn (or something similar to that), which asks the id command to look up the name of your primary group, which isn't listed in /etc/group.

Perhaps you used to have a group named egg that had GID 999; you could look for that with: grep ^egg: /etc/group. If it's not there, you could add it: sudo groupadd -g 999 egg.

Perhaps you meant to use a different GID when you created the egg account; if there is an egg group in /etc/group, but with a different GID -- say, 1000 -- then you could fix it with: usermod -g 1000 egg (or usermod -g egg egg).

  • I rebooted this morning and suddenly Im not running into the problem anymore. I will try the fix if it comes up again. – Rice Apr 21 '17 at 3:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.