0

When I try to create a new user account with command sudo adduser test-ser, I receive this error: sudo adduser test-user

Adding user test-user ...
Adding new group test-user (1069) ...
Adding new user 'test-user' (1032) with group 'test-user' ...
useradd: existing lock file /etc/subgid.lock without a PID
useradd: cannot lock /etc/subgid; try again later.
adduser: '/usr/sbin/useradd -d /home/test-user -g test-user -s /bin/bash -u 1032 test-user' returned error code 18. Exiting.

When I try to delete an already existing account I receive this error:

sudo deluser --remove-home existinguser  
Looking for files to backup/remove ...
Removing user `existinguser' ...
Warning: group `existinguser' has no more members.
userdel: existing lock file /etc/subgid.lock without a PID
userdel: cannot lock /etc/subgid; try again later.
/usr/sbin/deluser: `/usr/sbin/userdel existinguser' returned error code 18. Exiting.

1 Answers1

1
useradd: existing lock file /etc/subgid.lock without a PID

SInce it's this lock file that's causing the problem, and since it is without a PID (meaning there's no running process that's holding the lock and this is just some leftover of a previous attempt), I think you can delete it safely. Then try again.

muru
  • 207,228