Solved pkg: Unable to drop privileges: no 'nobody' user

Hi, After issues during the update process, I'm unable to install or update packages.
Currently, when I try to install a package, I get this error:

Unable to drop privileges: no 'nobody' user

Even when I try to update my system, it says I already have the latest update, and upgrading to version 14 is not possible for me.

I would appreciate it if you could help me resolve this issue:

uname -a:
FreeBSD FreeBSD 13.3-RELEASE-p7 FreeBSD 13.3-RELEASE-p7 GENERIC amd64
 
Following the advice given by Emrion you can indeed recreate the deleted user and do not forget to create the group "nobody" also.
First check if the user and the group nobody vanished:
$ grep nobody /etc/passwd
$ grep nobody /etc/groups


If it returns nothing then recreate them:
# pw groupadd nobody -g 65534
# pw useradd nobody -u 65534 -g 65534 -d /nonexistent -s /usr/sbin/nologin -c 'Unprivileged user'


Credit goes to SirDice, I found it in this thread:
 
The group of the same name and id is automatically created by adduser.
Yep that's right, I totally forgot that! thank you for the reminder :)

I suppose you can create it with adduser.

Name: nobody
Uid: 65534
Home: nonexistent
login: nologin
Use password: no
I've checked on couple of my systems and also looked in the man page I think it's /nonexistent.
-d partition
Home partition. Default partition, under which all user directories will be located.
The /nonexistent partition is considered special. The adduser script will not create
and populate a home directory by that name. Otherwise, by default it attempts to
create a home directory.
 
You're right, it's /nonexistent that has a special meaning for the script, not nonexistent.

That said, before to write my first answer I tested nonexistent as home dir and it worked. I mean it didn't create any directory. But, it seems that if you answer a random name, it's not created as well. It needs to begin by '/' otherwise nothing is done anyway.
 
Back
Top