Bird
0
0

A script uses groupadd -g 1001 devteam but fails with 'GID already in use'. How to fix?

medium📝 Debug Q7 of 15
Linux CLI - Users and Groups
A script uses groupadd -g 1001 devteam but fails with 'GID already in use'. How to fix?
AAll of the above
BChoose a different GID not in use
CDelete the existing group with GID 1001 first
DRemove the -g option to auto-assign GID
Step-by-Step Solution
Solution:
  1. Step 1: Understand GID conflict error

    The error means GID 1001 is already assigned to another group.
  2. Step 2: Possible fixes

    You can choose a different GID, omit -g to auto-assign, or delete the conflicting group.
  3. Final Answer:

    All of the above -> Option A
  4. Quick Check:

    Fix GID conflict = change GID, omit -g, or delete group [OK]
Quick Trick: GID conflicts require changing GID, deleting group, or omitting -g [OK]
Common Mistakes:
MISTAKES
  • Ignoring existing GID usage
  • Trying to reuse GID without deletion
  • Assuming syntax error instead of conflict

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes