25
submitted 3 weeks ago* (last edited 1 week ago) by arsus5478@lemmy.ml to c/linux@lemmy.ml

[SOLVED] I run sudo updatedb

locate is a command I've used in the past, but now, fresh installed with sudo apt get locate it doesn return anything.

locate --version returns locate (GNU findutils) 4.10.0, from 2024

or, have I forgotten something?

all 11 comments
sorted by: hot top controversial new old
[-] gnuhaut@lemmy.ml 9 points 3 weeks ago* (last edited 3 weeks ago)

locate uses an index you need to update using updatedb before it is able to find anything.

updatedb may run periodically because of a cron job, but the index is probably missing right after installing it manually.

[-] oshu@lemmy.world 9 points 3 weeks ago* (last edited 3 weeks ago)

run these two commands:

sudo apt install mlocate

sudo updatedb

[-] arsus5478@lemmy.ml 2 points 1 week ago

sudo updatedb

thanks!

[-] thingsiplay@beehaw.org 7 points 3 weeks ago

Several distributions made an effort to replace locate with alternative and updated versions of it. For usage the command name is still locate, but the package name should be different, in example mlocate or plocate and there are other alternatives too. The main difference between the old and new versions is they are faster.

[-] Botzo@lemmy.world 5 points 3 weeks ago

You can search the package database to determine which package(s) provide a file with dpkg --search $file

[-] gi1242@lemmy.world 4 points 3 weeks ago

IIRC u need mlocate or plocate...

[-] frongt@lemmy.zip 3 points 3 weeks ago

Is the package named findutils?

[-] tychosmoose@lemmy.world 2 points 3 weeks ago

Just tried this on a recent Trixie amd64 install. locate isn't installed by default, but there is a locate/stable 4.10.0-3 package and it installs just fine for me.

sudo apt update
sudo apt install locate
[-] MonkderVierte@lemmy.zip 1 points 3 weeks ago* (last edited 3 weeks ago)

Btw, there's also
IFS=:; find $PATH -executable -iname "$1" -print
Speed advantages of a indexed DB don't matter much anymore with nowadays hardware.

[-] limelight79@lemmy.world 1 points 3 weeks ago

I'm pretty sure it wasn't installed by default in the previous version either, and maybe even the one before that. It's a useful utility, after you locate it.

this post was submitted on 04 Sep 2025
25 points (100.0% liked)

Linux

58655 readers
308 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS