-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux groupdel Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to groupdel on Linux, covering Arch Linux, CachyOS, and other distributions including deleting groups, removing groups, and group cleanup.
groupdel deletes groups.
Uses:
- Remove groups: Delete group accounts
- Cleanup: Remove unused groups
- System maintenance: Manage groups
- Organization: Clean up groups
Warning:
- Check members: Verify no users in group
- Permissions: May affect file access
- Be careful: Verify before deleting
Delete group:
# Delete group
sudo groupdel groupname
# Group removedVerify group:
# Check group exists
getent group groupname
# Check members
getent group groupname | cut -d: -f4
# Remove members first if needed
sudo gpasswd -d username groupnameBefore deletion:
# Remove all members
sudo gpasswd -M "" groupname
# Or remove individually
sudo gpasswd -d username groupnameCheck removal:
# Verify deleted
getent group groupname
# Should return nothingFix issues:
# Check if group is primary
id username
# If group is primary GID, cannot delete
# Change user's primary group first
sudo usermod -g othergroup username
# Then delete
sudo groupdel groupnameThis guide covered groupdel usage, group deletion, and cleanup for Arch Linux, CachyOS, and other distributions.
- groupadd Guide - Group creation
- groupmod Guide - Group modification
- User and Groups - User management
-
groupdel Documentation:
man groupdel
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.