GNU/Linux >> Linux Esercitazione >  >> Cent OS

Come trovare a quale pacchetto appartiene un eseguibile o un file in RedHat/CentOS/Fedora?

Domanda: Vorrei sapere se c'è un comando in CentOS che mi consente di trovare a quale pacchetto appartiene un eseguibile, un file o una libreria? Ad esempio, come posso trovare quale pacchetto contiene /usr/bin/sha256sum eseguibile o quale pacchetto contiene un /usr/lib64/libnss3.so file di libreria.

Risposta:

Puoi usare rpm -qf comando per trovare a quale pacchetto appartiene un determinato eseguibile o file o libreria.

Formato:

$ rpm -qf <executable/file/library>

Come trovare un pacchetto che contiene un determinato eseguibile

$ rpm -qf /usr/bin/sha256sum
 coreutils-8.4-37.el6_7.3.x86_64

Come trovare a quale pacchetto appartiene una libreria

$ rpm -qf /usr/lib64/libnss3.so
 nss-3.19.1-5.el6_7.x86_64

Come trovare a quale pacchetto appartiene un file

$ rpm -qf /etc/httpd/conf/httpd.conf
 httpd-2.2.15-47.el6.centos.1.x86_64

Come elencare solo il nome del pacchetto senza informazioni sulla versione

Puoi utilizzare –queryformat opzione come mostrato di seguito:

$ rpm -qf /usr/bin/sha256sum --queryformat '%{NAME}\n'
 coreutils

Come trovare tutti i pacchetti di repository disponibili che forniranno un eseguibile o file o libreria?

$ yum provides /usr/bin/sha1sum
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit,
: security
Loading mirror speeds from cached hostfile
* base: dallas.tx.mirror.xygenhosting.com
* epel: mirror.compevo.com
* epel-debuginfo: fedora-epel.mirror.lstn.net
* extras: repos.dfw.quadranet.com
* updates: pubmirrors.dal.corespace.com
coreutils-8.4-37.el6.x86_64 : A set of basic GNU tools commonly used in shell
: scripts
Repo : base
Matched from:
Filename : /usr/bin/sha1sum
coreutils-8.4-37.el6_7.3.x86_64 : A set of basic GNU tools commonly used in
: shell scripts
Repo : updates
Matched from:
Filename : /usr/bin/sha1sum
coreutils-8.4-37.el6_7.3.x86_64 : A set of basic GNU tools commonly used in
: shell scripts
Repo : installed
Matched from:
Other : Provides-match: /usr/bin/sha1sum

Questo è tutto.


Cent OS
  1. Come aggiornare CentOS 7 a CentOS 8

  2. Come estrarre il pacchetto 7z in CentOS/RHEL/Fedora?

  3. Come installare MediaWiki su CentOS/Fedora

  4. Come installare Drupal su CentOS/Fedora

  5. Come installare tar.gz in CentOS

Come installare un file RPM su sistema operativo Linux (CentOS, RHEL e Fedora)

Come installare il filato su CentOS 7

Come installare il filato su CentOS 8

Come installare RPM su CentOS

Come scoprire a quali gruppi appartiene un utente in Linux

Come installare i pacchetti RPM in CentOS, RHEL e Fedora