So say I have two groups with names testing1 and testing2. Both groups have the same group ID of 2000. Then I add a user named testing-user with GID of 2000. Along the way I want to delete group testing2, but I cannot because when I try I get the following response
groupdel: cannot remove the primary group of user 'testing-user'
Here are the methods I have tried around this to success:
Modified testing1's GID and then deleted testing2, then changed testing1's GID back to 2000
Modified testing-user's primary GID to a separate group, deleted testing2 then assigned testing-user to testing1
Is there a better method for this that does not involve modifying the users or group id's in question?