SUSEInstallLocate

How to install locate under Open Suse

Yet another weird technical choice by Open Suse (or Suse in general): by default, locate is not installed.

Why?? WHY? Oh, the humanity...

$ locate traceroute
If 'locate' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf locate

$ which locate
which: no locate in (/home/gil/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games)

Anyway, this is easy enough to correct (as root, of course):

# zypper search locate
Loading repository data...
Reading installed packages...

S | Name                      | Summary                                        | Type      
--+---------------------------+------------------------------------------------+-----------
  | findutils-locate          | Tool for Locating Files (findutils subpackage) | package   
  | libfallocate-devel        | Header and devel files for libfallocate        | package   
  | libfallocate-devel-static | Static library for libfallocate                | package   
  | libfallocate0             | Filesystem preallocation interface library     | package   
  | mlocate                   | An utility for finding files by name           | package   
  | mlocate                   | An utility for finding files by name           | srcpackage
  | mlocate-lang              | Languages for package mlocate                  | package   
  | vim-plugin-locateopen     | Edit file without entering the whole path      | package

# zypper install findutils-locate

( ... some output here ... )


# zypper search locate
Loading repository data...
Reading installed packages...

S | Name                      | Summary                                        | Type      
--+---------------------------+------------------------------------------------+-----------
i | findutils-locate          | Tool for Locating Files (findutils subpackage) | package   
  | libfallocate-devel        | Header and devel files for libfallocate        | package   
  | libfallocate-devel-static | Static library for libfallocate                | package   
  | libfallocate0             | Filesystem preallocation interface library     | package   
  | mlocate                   | An utility for finding files by name           | package   
  | mlocate                   | An utility for finding files by name           | srcpackage
  | mlocate-lang              | Languages for package mlocate                  | package   
  | vim-plugin-locateopen     | Edit file without entering the whole path      | package   


# updatedb

The first zypper command looks for the utility itself, then install. The command updatedb takes a few minutes to complete, but creates the initial locate database for you.

That's all there is to it, but I have to admit it was weird finding myself on a computer without locate! :-D