adduser says user exists when the user does not exist

Is there any reason you are specifying the uid rather than letting the system choose one for you? You can see if your chosen id is in use by doing grep '10141' /etc/passwd. If that is the case then the error message is certainly a bit misleading :/

It's also quite possible that your system recognises users who are not in /etc/passwd - for example by using LDAP. One quick way to test that is to do id atc and see if the system recognises it. Another way would be getent passwd atc which will also show you users the system recognises who are not in /etc/passwd. Or you could again check if the uid is in use with getent passwd 10141. (You can also run getent passwd to get the full list of entries.) More about getent.

To see where these users might come from you could look at /etc/nsswitch.conf (man page) - the line starting passwd will show you where your system is looking for users. Common default values are files and compat, though more complex setups may have multiple values including values such as ldap, dns and winbind. files means the standard files including /etc/passwd.

I'm not so clear on the exact meaning of compat, but my reading of the nsswitch.conf man page suggests it is a combination of files and nis. nis is the Network Information Service which is largely superceded these days but may affect your system.


Try typing the following in a terminal

sudo userdel -r atc

This should remove all instances of the user

Tags:

Users

Adduser