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.
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.
run these two commands:
sudo apt install mlocate
sudo updatedb
sudo updatedb
thanks!
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.
You can search the package database to determine which package(s) provide a file with dpkg --search $file
IIRC u need mlocate or plocate...
Is the package named findutils?
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
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.
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.
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.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0