I am working through some curriculum on learning Linux, in it they showed using the locate command but I could not get it to run in OpenSuse. I did some research and discovered that it is not installed by default. I tried using Yast to install “findutils-locate” and it had trouble with what looked like updating it’s database ebut eventually finished, I searched for “findutil” in what I believe is called the Software Manager. I was in the “Add-on Product” screen and clicked on the “Run Software Manager” so now I can see findutils in the RPM Groups -> Productivity -> File utilities but I was still unable to get locate to run on the command line. I found this forum and a post by wolfi323 in which he wrote
It is not installed by default anymore.
But you can easily install it by typing:
Code:
sudo zypper in findutils-locate
So I ran that on the command line and now it works. I see that it says “findutils-locate” which I was unable to find in the Software Manager. So, what am I doing wrong? What should I have searched for? and what is zypper?
The following 2 NEW packages are going to be installed:
mlocate mlocate-lang
I don’t know why zypper se findutils-locate fails to find it.
zypper info --provides mlocate
Information for package mlocate:
--------------------------------
Repository : openSUSE-Leap-42.3-0
Name : mlocate
Version : 0.26-25.1
Arch : x86_64
Vendor : openSUSE
Installed Size : 143.5 KiB
Installed : No
Status : not installed
Source package : mlocate-0.26-25.1.src
Summary : An utility for finding files by name
Description :
A new locate implementation. The m character
stands for merging, because updatedb reuses the
existing database to avoid re-reading most of the
file system.
Provides : [5]
findutils:/usr/bin/locate
config(mlocate) = 0.26-25.1
**findutils-locate** = 5.0.26
mlocate = 0.26-25.1
mlocate(x86-64) = 0.26-25.1
Simply running the command in the terminal should show you some useful info. For example the program locate.
locate
if 'locate' is not a typo you can use command-not-found to lookup the package that contains it, like this:
**cnf locate**
Now you have some info about the command is not found and then it tells you what to do next.
cnf locate
The output would be something like this.
The program 'locate' can be found in the following package:
* mlocate path: /usr/bin/locate, repository: zypp (repo-oss) ]
Try installing with:
sudo zypper install mlocate
Although even if you don’t know the exact package/program name you can still use zypper.
zypper se locate
Loading repository data...
Reading installed packages...
S | Name | Summary | Type
--+---------------------------+--------------------------------------------+--------
| 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-lang | Languages for package mlocate | package
| vim-plugin-locateopen | Edit file without entering the whole path | package
Not very precise but still the Summary column can tell what/which program is it.