Ubuntu – useradd: cannot lock /etc/subuid; try again later

dpkguseradd

So, while trying to upgrade to 14.04 I encountered this error:

Could not calculate the upgrade

An unresolvable problem occurred while calculating the upgrade.

Please report this bug against the 'update-manager' package and include the following error message: 'E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.'

I looked into it and opened the /var/log/dist-upgrade/apt.log log file in a text editor, locating any "broken" packages and remove them with sudo apt-get remove . I had 33 broken packages.

I typed "sudo apt-get update && sudo apt-get upgrade" to see if there were any packages: there were 2 packages which didn't want to update: libboost-filesystem-dev and libboost-thread-dev, so i removed them to see if I was able to get a correct upgrade.

It didn't work.

I'm now getting an error about unresolved dependencies and can't do anything. I tried the following ways to get out of it:

  1. sudo apt-get -f install, this is the output (it's in italian, sorry about that)

http://pastebin.com/y2DTqxdQ

Basing on this, it can't install this "usermetricsservice_1.1.1+13.10.20131003-0ubuntu1_amd64.deb" and even using software center opening it manually, gives error.

  1. sudo apt-get -u dist-upgrade, similar output as before

http://pastebin.com/k6DETpzV

This is the output with "sudo dpkg –configure -a" : http://pastebin.com/SEj83RSP

Edit: After rebooting, I managed to fix the broken dependencies through "sudo apt-get -f install", still I can't upgrade ubuntu for the same error as before and I'm not sure sure what's the problem here.

This is the output of "sudo lsof /etc/subuid"

lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
  Output information may be incomplete.

Best Answer

I had that error just one moment ago, and finally I've resolved. I did this:

1- Try $ sudo useradd nickname.

2- The response, if you have the error, should be like this: 'useradd: existing lock file /etc/subgid.lock without a PID useradd: cannot lock /etc/subgid, please try again.'

3- Now you have to remove all the files that are making the error, they are, in my case subgid.lock. (You can see that in the response says 'existing lock file /etc/subgid.lock', so you have to remove all files that is put in the response). Do this: $ sudo mv subgid.lock /home/youruser/subuid.lock.sav. Substituting subgid.lock for your error file.

4- Try again $ sudo useradd nickname. If shows other error file, remove it. If no more error files are there, you should get now the new user.

This was very useful for me, so I hope that you can fix the problem =). And sorry for my english because I'm spanish. Good bye and good luck.

Related Question