8

I have installed the mlocate package on Asus RT-N56U running Padavan with Entware-ng, which is based on OpenWrt. This embedded Linux distribution has SSH enabled.

My locate results are out of date. When I use the updatedb command this error appears:

updatedb: can not find group mlocate

How can I fix this, preferably with one liner?

2 Answers 2

9

The addgroup package is necessary and is included in busybox of padavan firmware.

Do the following steps as root:

grep -s mlocate /etc/group || addgroup mlocate
chgrp mlocate /opt/var/mlocate
chmod g=rx,o= /opt/var/mlocate
chgrp mlocate /opt/bin/locate
chmod g+s,go-w /opt/bin/locate
touch /opt/var/mlocate/mlocate.db
chgrp mlocate /opt/var/mlocate/mlocate.db

This is the one-liner (a single copy and paste command) to fix the "updatedb: can not find group mlocate" message:

# grep -s mlocate /etc/group || addgroup mlocate;chgrp mlocate /opt/var/mlocate;chmod g=rx,o= /opt/var/mlocate;chgrp mlocate /opt/bin/locate;chmod g+s,go-w /opt/bin/locate;touch /opt/var/mlocate/mlocate.db;chgrp mlocate /opt/var/mlocate/mlocate.db
1
  • I ran into the same issue with Plesk on Ubuntu 18.04. Running addgroup mlocate solved it, apparently no other steps were needed.
    – vic
    Commented Nov 6, 2023 at 9:47
0

for those that don't have the addgroup package.

use this command instead synogroup -add mlocate

grep -s mlocate /etc/group || synogroup -add mlocate
chgrp mlocate /opt/var/mlocate
chmod g=rx,o= /opt/var/mlocate
chgrp mlocate /opt/bin/locate
chmod g+s,go-w /opt/bin/locate
touch /opt/var/mlocate/mlocate.db
chgrp mlocate /opt/var/mlocate/mlocate.db

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .