6

Since locate doesn't work by default in Ubuntu 22.04.1 LTS, and the message on the terminal says:

Command 'locate' not found, but can be installed with:
sudo apt install plocate

As we can see, it says that we can install it with sudo apt install plocate.

I want to know the difference between mlocate and plocate so that I can decide which one to install.

1 Answers1

8

plocate is backwards-compatible with mlocate, and is much faster and more efficient than mlocate.

In fact you don’t have a choice between mlocate and plocate in Ubuntu 22.04: if you install the former, you’ll end up with the latter anyway, because mlocate is a transitional package which pulls in plocate.

Stephen Kitt
  • 434,908
  • According to plocate.sesse.net, it uses an inverted index over trigrams (combinations of 3 bytes) in search strings, which allows it to rapidly narrow down the set of candidates to a very small list, instead of linearly scanning through every entry. – Juergen Jan 24 '24 at 15:05