0

MEGA summary: How to search for programs easier when there is no access to GUI internet browser, I have no phone on me etc. Just having CLI in linux.

Let's say I'm using CentOS 7 and I'm looking for a program to install. I want to install "locate" command. To do it I write yum search locate. The shell answers with a list of packages.

mlocate.x86_64 : An utility for finding files by name
perl-File-ShareDir.noarch : Locate per-dist and per-module shared files
which.x86_64 : Displays where a particular program in your path is located

In this case I intuitively know that the mlocate.x86_64 is probably what I'm looking for, so I install it by yum install mlocate.x86_64 but I have an enormous trouble doing that with programs that when searched for are being given to me as a giant list of packages. For example: I install minimal installation centos 7. After doing that i search for a dekstop environment xfce yum search xfce. The output is massive and I don't know what even are these packages. I do know that xfce is a "desktop environment" so I yum search xfce | grep dekstop. That gives me:

libxfce4util.i686 : Utility library for the Xfce4 desktop environment
libxfce4util.x86_64 : Utility library for the Xfce4 desktop environment
xfce4-power-manager.x86_64 : Power management for the Xfce desktop environment
exo.i686 : Application library for the Xfce desktop environment
exo.x86_64 : Application library for the Xfce desktop environment
xfdesktop.x86_64 : Desktop manager for the XFce Desktop Environment

The only thing that comes close to what I think I want is:

xfdesktop.x86_64 : Desktop manager for the XFce Desktop Environment

However I am not certain. Nowhere does it say "Xfce desktop environment". It just says that it's a Desktop manager for that environment. I don't know what that means. Maybe that particular example just shows that I'm stupid but I'm having this problem with many programs that I want to install.

I search for an ssh client:

[root@box-codeanywhere /]# yum search ssh | grep client
gsi-openssh-clients.x86_64 : SSH client applications with GSI authentication
libguac-client-ssh.i686 : SSH support for guacd
libguac-client-ssh.x86_64 : SSH support for guacd
ne7ssh.i686 : SSH Library is a Secure Shell client software written in C++
ne7ssh.x86_64 : SSH Library is a Secure Shell client software written in C++
openssh-clients.x86_64 : An open source SSH client applications
perl-Net-OpenSSH.noarch : Perl SSH client package implemented on top of OpenSSH
perl-Net-SSH-Perl.noarch : SSH (Secure Shell) client
dropbear.x86_64 : SSH2 server and client
perl-Net-SFTP-Foreign.noarch : SSH File Transfer Protocol client
putty.x86_64 : SSH, Telnet and Rlogin client
                            : clients and server

How do I know which package I need to install... I'm having this problem extremely often. It looks like I need to know the exact name string of a package responsible for installing certain program. My question is: How to search for program easier when there is no access to GUI internet browser, I have no phone on me etc. Just having CLI in linux.

1

Your tool for searching for a program is apt-file, which you install this way :

# Install apt-file, which allows you to search
# for the package containing a file
sudo apt-get install apt-file

# Update the package/file mapping database
sudo apt-file update

If you know the absolute path for the program, you may search for it :

$ apt-file search /usr/bin/locate

Or you may search for the program appearing in the path :

# Search for "locate" at the end of a path
apt-file search --regexp '/locate$'

In the output only one package will specify an executable located in your standard PATH, which gives a clue that it might be the right one.

You can also find out more about the package to ensure that it seems like the right one:

$ apt-cache show <package-name>

This will list all the programs included in the package and can serve as verification.

Yum also accepts the command whatprovides (or provides) to search for installed or not installed binaries:

yum whatprovides <path-to-file>

zypper's search command can check file lists when used with the -f option :

zypper se -f /usr/bin/locate

Pkgfile, available as pkgtools for pacman based systems, provides a similar search feature like the others above:

pkgfile -si /usr/bin/mysqldump

Fore more information see :

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.