dpkg -S {file} #ubuntu 14.04 rpm -qf {file} #centos 7

Linux command to find the corresponding installation package or component method
original FJEagle Last post on 2017-12-15 19:10:06 read the number 4603 collection
expansion
method corresponding to the installation package for Linux find command or components
when the server is set up a new server or maintenance unfamiliar environment, will inevitably encounter case they want to use the command or component does not exist. How to package management software, easy to find commands or components corresponding package installed? Here are three ways.

Name Search
an intuitive way is, command guessing or assembly or installation package of the same name comprising, tries to search for installation. For example, you want to install redis database:

 

Search repo related commands:

apt-cache search {cmd} #ubuntu 14.04

Search cmd} {#centos yum. 7
. 1
2
. 3
command-not-found components: automatically prompt command
command-not-found assembly support when the command is not found, the command tips corresponding mounting statement as follows:

 

command-not-found installation method:

APT Search the Command-Cache #-not-found
APT-GET install the Command-not-found the #ubuntu 14.04 (it may have preinstalled)

Search Command-Not-#yum found
yum the install PackageKit -Y-Command-Not-found #centos. 7
. 1
2
. 3
. 4
. 5
files Lookup installation package
if the environment around the other, the corresponding command or already installed components, can pegging the corresponding installation package by the installed files, such as finding ss command:

 

Lookup command file corresponding installation package:

-S File} {the #ubuntu dpkg 14.04
RPM -qf File} {#centos. 7
. 1
2
Further, ubuntu the apt-file command file installation package also supports the reverse lookup installation package, even if the installation package is not installed.
----------------
Disclaimer: This article is the original article CSDN bloggers "FJEagle", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/FJEagle/java/article/details/78815818

 

Guess you like

Origin www.cnblogs.com/xuanbjut/p/12621310.html