3

I'm sorry this post is so long, but I wanted to make sure that all the stuff that might be relevant was readily available.

I've been trying to create a new user account on my laptop, and, even though I tried everything I found online, I'm still not able to do it. I would like to remark that I was not using uppercase letters (which seems to be the reason why some other users could not create a new account on the questions I checked).

First of all, I tried to create an account in GUI mode. After entering the new username on the account creation dialog I get this message:

running '/usr/sbin/adduser' failed: Child process exited with code 1

After some googling I downloaded gnome-system-tools from the Ubuntu Software Centre. I enter all the data on the "Create New User" dialog and this is what I get:

The configuration could not be saved
Invalid data was found.

That's when I decide to open the terminal and see what was going on. I enter the command sudo adduser newuser I get this:

adduser: The group `newuser' already exists.

so I delete the group using the command sudo delgroup newuser, and use the previous command again. After doing so, I get this:

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

Again, the newuser group is created, but not the user. However, when using the useradd command instead of adduser, I just get the two useradd lines above and no group is created. In neither case I'm able to create a new user. I also tried all these commands opening the terminal as root and it was useless. What should I do now?

Edit: I rebooted the machine twice, and repeated the process using the terminal as root. It did not work.

  • 1
    Have you tried rebooting your machine? – s3lph Dec 30 '14 at 23:22
  • @the_Seppi Oh, yes. Twice. – Tipsy Triceratops Dec 30 '14 at 23:25
  • Try removing the file /etc/subgid.lock. It seems like some process using this lock crashed or didn't work correctly (e.g. a faulty package installation/removal script) – s3lph Dec 30 '14 at 23:28
  • @the_Seppi Thank you! It worked :) (I had to remove it using the terminal as root, though). – Tipsy Triceratops Dec 30 '14 at 23:34
  • It might also be worthwhile running sudo pwck -q to see if the files have been left in an inconsistent state – steeldriver Dec 30 '14 at 23:36
1

Since there's a warning about some lockfile, I assume that some process who changed user or group information failed at some point and the file persisted.

First check, whether a process still claims this file: fuser /etc/subgid.lock. If nothing is returned, you can safely remove this file sudo rm /etc/subgid.lock.

Then it should work again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.