diff --git a/distrobox-init b/distrobox-init index febb2f8dad..82cea2d37b 100755 --- a/distrobox-init +++ b/distrobox-init @@ -216,7 +216,9 @@ echo "${container_user_name} ALL = (root) NOPASSWD:ALL" >>/etc/sudoers # Let's add our user to the container # if the user already exists, just add it to the sudoers groups -groupadd --force --gid "${container_user_uid}" "${container_user_name}" +if ! grep -q "${container_user_name}" /etc/group; then + groupadd --force --gid "${container_user_uid}" "${container_user_name}" +fi if ! useradd \ --home-dir "${container_user_home}" \ --no-create-home \