From e9a67e5ae1ede0d5762f178dbdce5160653126b6 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 7 Jan 2018 18:12:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=BC=E5=BC=8F=E7=B2=97?= =?UTF-8?q?=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 代码高亮和换行 --- ... is package installed to on CentOS-RHEL.md | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sources/tech/20180105 yum find out path where is package installed to on CentOS-RHEL.md b/sources/tech/20180105 yum find out path where is package installed to on CentOS-RHEL.md index b0805e08ec..01fe3928ce 100644 --- a/sources/tech/20180105 yum find out path where is package installed to on CentOS-RHEL.md +++ b/sources/tech/20180105 yum find out path where is package installed to on CentOS-RHEL.md @@ -16,13 +16,18 @@ yum is similar to other high level package managers like [apt-get command][3]/[a ### yum where is package installed The syntax is as follows to install htop package for a demo purpose: + `# yum install htop` + To list the files installed by a yum package called htop, run the following rpm command: + ``` # rpm -q {packageNameHere} # rpm -ql htop ``` + Sample outputs: + ``` /usr/bin/htop /usr/share/doc/htop-2.0.2 @@ -38,9 +43,11 @@ Sample outputs: ### How to see the files installed by a yum package using repoquery command First install yum-utils package using [yum command][2]: + ``` # yum install yum-utils ``` + Sample outputs: ``` @@ -102,15 +109,24 @@ Complete! ### How do I list the contents of a installed package using YUM? Now run repoquery command as follows: + `# repoquery --list htop` + OR + `# repoquery -l htop` + Sample outputs: + [![yum where is package installed][5]][5] + You can also use the type command or command command to just find location of given binary file such as httpd or htop: -`$ type -a httpd + +``` +$ type -a httpd $ type -a htop -$ command -V htop` +$ command -V htop +``` ### about the author