next up previous contents
Next: yum安裝、升級與移除 Up: YUM 線上升級機制 Previous: yum容器設定   Contents

yum查詢功能

  1. 查詢選項:
    [root@demo ~]# yum [options] [command] [package ...]
    [option]:主要的搜尋選項有:
    [查詢工作項目] [相關參數]:這方面的參數有:
      search  :搜尋某個套件名稱或是描述 (description) 的重要關鍵字;
      list    :列出目前 yum 所管理的所有的套件名稱與版本,有點類似 rpm -qa;
      info    :列出套件的相關訊息,類似 rpm -qai 的執行結果;
      provides or whatprovides:搜尋包含某檔案的套件,類似 rpm -qf 的功能。
    
  2. 查詢名稱或是描述中包含關鍵字cjk的套件
    [root@demo ~]# yum search cjk
    ================================= Matched: cjk =================================
    cjkuni-fonts-common.noarch : Common package of CJK Unifonts
    cjkuni-fonts-ghostscript.noarch : Chinese Unicode TrueType font ghostscript
                                    : files
    cjkuni-ukai-fonts.noarch : Chinese Unicode TrueType font in Kai face
    cjkuni-uming-fonts.noarch : Chinese Unicode TrueType font in Ming face
    bitmap-fangsongti-fonts.noarch : Selected CJK bitmap fonts for Anaconda
    m17n-db-common-cjk.noarch : Common m17n-db files for CJK input
    wqy-zenhei-fonts.noarch : WenQuanYi Zen Hei CJK Font
    wqy-zenhei-fonts-common.noarch : Common files for WenQuanYi Zen Hei CJK Font
    bitmap-lucida-typewriter-fonts.noarch : Selected CJK bitmap fonts for Anaconda
    dvipdfmx.x86_64 : A DVI to PDF translator
    poppler-data.noarch : Encoding files
    
  3. 查看套件cjkuni-ukai-fonts的相關訊息
    [root@demo ~]# yum info cjkuni-ukai-fonts
    Loaded plugins: refresh-packagekit, rhnplugin
    This system is not registered with RHN.
    RHN support will be disabled.
    Available Packages
    Name       : cjkuni-ukai-fonts
    Arch       : noarch
    Version    : 0.2.20080216.1
    Release    : 34.el6
    Size       : 9.4 M
    Repo       : base     <==在安裝來源base中尚未安裝,若安裝會顯示installed
    Summary    : Chinese Unicode TrueType font in Kai face
    URL        : http://www.freedesktop.org/wiki/Software/CJKUnifonts
    License    : Arphic
    Description: 
               : CJK Unifonts are Unicode TrueType fonts derived from original fonts
               : made available by Arphic Technology under "Arphic Public License"
               : and extended by the CJK Unifonts project.
               : 
               : CJK Unifonts in Kai face.
    
  4. 列出所有evince開頭的套件
    [root@demo ~]# yum list evince*
    Installed Packages
    evince.x86_64       2.28.2-14.el6     @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0
    evince-dvi.x86_64   2.28.2-14.el6     @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0
    evince-libs.x86_64  2.28.2-14.el6     @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0
    Available Packages
    evince.x86_64       2.28.2-14.el6_0.1 rhel-beta                                 
    evince-devel.i686   2.28.2-14.el6_0.1 rhel-beta                                 
    evince-devel.x86_64 2.28.2-14.el6_0.1 rhel-beta                                 
    evince-dvi.x86_64   2.28.2-14.el6_0.1 rhel-beta                                 
    evince-libs.i686    2.28.2-14.el6_0.1 rhel-beta                                 
    evince-libs.x86_64  2.28.2-14.el6_0.1 rhel-beta
    
  5. 列出可升級的evince開頭的套件
    [root@demo ~]# yum list updates evince*
    Updated Packages
    evince.x86_64                       2.28.2-14.el6_0.1                  rhel-beta
    evince-dvi.x86_64                   2.28.2-14.el6_0.1                  rhel-beta
    evince-libs.x86_64                  2.28.2-14.el6_0.1                  rhel-beta
    
  6. 列出包含檔案bin/evince的所有套件,例如/usr/bin/evince
    [root@demo ~]# yum provides *bin/evince
    rhel/filelists_db                                                        | 5.6 MB     03:46     
    rhel-beta/filelists_db                                                   | 2.6 MB     02:08     
    evince-2.28.2-14.el6.x86_64 : Document viewer
    Repo        : rhel
    Matched from:
    Filename    : /usr/bin/evince
    
    evince-2.28.2-14.el6_0.1.x86_64 : Document viewer
    Repo        : rhel-beta
    Matched from:
    Filename    : /usr/bin/evince
    
    evince-2.28.2-14.el6.x86_64 : Document viewer
    Repo        : installed
    Matched from:
    Filename    : /usr/bin/evince
    



2015-04-13