yum으로 설치된 패키지를 찾는 방법은 무엇입니까?

yum으로 설치된 패키지를 찾는 방법은 무엇입니까?

나는 yum list php-imapphp-imap을 사용하여 목록을 작성합니다:

# yum list php-imap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.zju.edu.cn
 * epel: ftp.cuhk.edu.hk
 * extras: mirrors.zju.edu.cn
 * updates: mirrors.zju.edu.cn
 * webtatic: sp.repo.webtatic.com
Installed Packages
php-imap.x86_64                        5.4.16-7.el7                        @epel

그런데 그 위치를 어떻게 찾을 수 있나요? 검색 에 사용할 수 있다는 것을 알고 있지만 find / -name php-imap매번 시간이 너무 길고 명령조차 반응하지 않습니다.


내 CentOS 7에서는 이것이 /var/tmp/빈 디렉토리입니다. 및 목록 /var/cache/yum/x86_64/7/:

base epel extras mysql56-community mysql-connectors-community mysql-tools-community timedhosts timedhosts.txt updates webtatic. 

php-imap아니요

답변1

rpm 파일이 어디에 있는지 궁금하다면 yum 구성에 따라 시스템이 해당 파일을 유지할 수도 있고 그렇지 않을 수도 있습니다. /etc/yum.conf에서 "cachedir=" 줄을 확인하세요(이것이 모든 시스템에서 올바른 위치인지는 확실하지 않지만 내 Centos 컴퓨터에서는 그렇습니다). 그러면 rpm 캐시가 어디에 있는지 알 수 있습니다. 예를 들어:

grep cachedir /etc/yum.conf 

내 시스템에는 /var/cache/yum/$basearch/$releasevar가 표시됩니다.

동일한 파일에 keepcache=0을 포함하면 시스템이 rpm을 저장하지 않습니다. 유지하려면 keepcache=1로 변경하세요. 보관 공간에 따라 수시로 청소가 필요할 수 있습니다.

실제 소프트웨어가 시스템의 어디에 있는지 알고 싶다면 다음을 수행하십시오.

rpm -qa | grep php-imap

그런 다음 결과에서 패키지 이름을 가져오고(php-imap.x86_64일 수 있음) 다음을 수행합니다.

rpm -q --filesbypkg <package full name here>

답변2

귀하의 질문이 설치된 패키지 사용에 관한 것이므로 옵션 과 "하위 플래그"를 yum확인해야 합니다 . ~에 따르면infolist냠냠:

       info           Display details about a package or group of packages 
       list   Is used to list various information about available packages;

        LIST OPTIONS
       The following are the ways which you can invoke yum in list mode.  Note that all list commands include information on the version of the package.

       OUTPUT

              The format of the output of yum list is:

              name.arch [epoch:]version-release  repo or @installed-from-repo

              Note that if the repo cannot be determined, "installed" is printed instead.

       yum list [all | glob_exp1] [glob_exp2] [...]
              List all available and installed packages.

       yum list available [glob_exp1] [...]
              List all packages in the yum repositories available to be installed.

       yum list updates [glob_exp1] [...]
              List all packages with updates available in the yum repositories.

       yum list installed [glob_exp1] [...]
              List the packages specified by args.  If an argument does not match the name of an available package, it is assumed to be a shell-style glob and any matches are printed.

       yum list extras [glob_exp1] [...]
              List the packages installed on the system that are not available in any yum repository listed in the config file.

       yum list distro-extras [glob_exp1] [...]
              List the packages installed on the system that are not available, by name, in any yum repository listed in the config file.

       yum list obsoletes [glob_exp1] [...]
              List the packages installed on the system that are obsoleted by packages in any yum repository listed in the config file.

       yum list recent
              List packages recently added into the repositories. This is often not helpful, but what you may really want to use is "yum list-updateinfo new" from the security yum plugin.

또한 설치된 패키지의 경로는 시스템 설정에 따라 다릅니다.

센토스7에서

/var/tmp/yum-root-xxxxx/ 

또는

/var/tmp/yum-username-xxxxx/

또는

/var/cache/yum/x86_64/7/program_name/packages/

RHEL에서는 파일이 다음 위치에 저장됩니다.

/var/cache/yum/x86_64/6Server/rhel-6-server-rpms/packages/

관련 정보