What goes into default Debian?
The venerable locate
file-finding utility has long been available for Linux systems, though its
origins are in the BSD world. It is a generally useful tool, but does have
a cost beyond just the disk space it occupies in the filesystem; there is a
periodic daemon program (updatedb)
that runs to keep the file-name database up to date. As a recent
debian-devel discussion shows, though, people have differing ideas of
just how important the tool is—and whether it should be part of the default installation of Debian.
There are several variants of locate floating around at this point. The original is described in a ;login: article from 1983; a descendant of that code lives on in the GNU Find Utilities alongside find and xargs. After that came Secure Locate (slocate), which checks permissions to only show file names that users have access to, and its functional successor, mlocate, which does the same check but also merges new changes into the existing database, rather than recreating it, for efficiency and filesystem-cache preservation. On many Linux distributions these days, mlocate is the locate of choice.
But Steinar H. Gunderson has created another variant, plocate, which he has suggested should be the standard locate for the upcoming Debian 12 ("Bookworm") release. He said that plocate can completely supplant mlocate:
He pointed out that mlocate used to be installed by default, but that was changed for Debian 10 ("Buster"). He would like to see locate return as part of the default install, but to use plocate instead:
Bernd Zeimetz agreed
that plocate should be part of the default install, as
did Paul Wise, but Wise was concerned about the cost of keeping the
database updated. Gunderson said
that plocate (like mlocate) tries to be smarter than
simply walking the whole filesystem. "It keeps track of the mtime of
each directory, and doesn't do the
readdir()/getdents() if it hasn't changed.
" But Josh Triplett argued that while
plocate is a good choice for the default locate for
Debian, it should not be part of the default (or base) install:
Beyond that, he pointed out that desktop environments often provide similar
functionality, "typically based on a change-watching API (e.g. inotify)
rather than a regularly scheduled update
". Gunderson said
that the amount of wasted time generally amounts to "a few
seconds every night
". Triplett noted that there
was a counterexample to that figure in the thread, but he also made a broader point about
defaults in the distribution:
The defaults need to cater for 1) the broadest set of users, and 2) users who are less likely to change the defaults. Most users don't run locate, and those who do are more likely to be users who can and do change the defaults. `apt install plocate` isn't hard for someone who uses locate to do.
But, as Gunderson pointed
out, systems that are shared by multiple users could benefit from
having locate available—without having to ask an administrator to
install it. He suggested that locate is a standard tool for users
of the command line, as well. Adrian Bunk said that
shared systems are "pretty rare
", but Russ Allbery pointed out that
"rare" might not be the right characterization: "They've become
*rarer*, but they're still very common in the academic and
scientific research world.
"
Bunk also noted that many non-technical Linux users never actually touch
the shell. Gunderson wondered
why Debian installs a whole host of other utilities (e.g. netcat,
lsof, the PCI utilities) that are really only
useful for technical, shell-aware Linux users. Those utilities are
"expected to be on a typical Linux system by almost
every technically-knowledgeable Linux user
", Marvin Renich said,
but locate does not quite rise to that level.
Others disagreed, of course. Bjørn Mork drew the line
differently, noting that administrators can always add tools that they
need, but sometimes users cannot:
In addition,
not having locate available by default is "yet another step away from being a
proper Unix system
", Mork said. Holger Levsen suggested
that it was perhaps time for someone to create a package that installs a "proper Unix system".
There would, of course, be differing opinions on what constitutes such a
system, which is part of what is driving the question of a default locate
as well. One suspects that hair length
or color
would not actually play much of a role as was (jokingly) suggested, but
several
packages with different choices could be accommodated, as Levsen noted.
So it would seem that plocate will be the default locate for Debian, though mlocate will still be available, but neither will be installed by default. Or at least there was no huge groundswell of support to change the current practice. That is in keeping with the practice of other Linux distributions (Fedora, openSUSE, Ubuntu, and RHEL, at least), but it is understandable that locate might be missed. find is a reasonable substitute, but it lacks the instant feedback that locate provides. For me, that's worth installing an extra package and expending a few seconds per day—your mileage may vary.
