Linux系统之前端程序包管理器(2)

1、列出所有可用repo
          yum repolist {enabled|disabled|all}  enabled:可用的;disabled:不可用的;all:所有的 ,不带参数默认为列出可用的
[root@CentOS6 yum.repos.d]# yum repolist enabled
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
repo id                  repo name              status
c6-cd                  CentOS-6 - cd          4,802
repolist: 4,802
[root@CentOS6 yum.repos.d]# yum repolist disabled
Loaded plugins: fastestmirror, refresh-packagekit, security
repo id                  repo name                                             
c6-media                  CentOS-6 - Media                                     
repolist: 0
[root@CentOS6 yum.repos.d]# yum repolist all
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
repo id                repo name                  status
c6-cd                  CentOS-6 - cd              enabled: 4,802
c6-media              CentOS-6 - Media            disabled
repolist: 4,802
[root@CentOS6 yum.repos.d]#


      2、列出rpm包
          yum list {all|installed|available}  all:所有的;installed: 已安装的;available:可以安装的;默认为列出所有的
          yum list KEYWORD*  支持使用文件名通配,来获取含有关键字的rpm包
[root@CentOS6 yum.repos.d]# yum list http*  #列出所有以http开头的rpm包
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Installed Packages  #下面为已经安装的包
httpd-tools.i686      2.2.15-29.el6.centos    @anaconda-CentOS-201311271240.i386/6.5
Available Packages  #下面为可以安装的包
httpd.i686            2.2.15-29.el6.centos    c6-cd                               
httpd-devel.i686      2.2.15-29.el6.centos    c6-cd                               
httpd-manual.noarch  2.2.15-29.el6.centos    c6-cd

3、列出包的描述信息(无论包有没有安装都可以列出)
          yum info package_name
[root@CentOS6 yum.repos.d]# yum info httpd #列出http包的描述信息
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Available Packages
Name        : httpd
Arch        : i686
Version    : 2.2.15
Release    : 29.el6.centos
Size        : 828 k
Repo        : c6-cd
Summary    : Apache HTTP Server
URL        :
License    : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
            : web server.

4、列出所有的包组信息
          yum grouplist
[root@CentOS6 yum.repos.d]# yum grouplist
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Group Process
Loading mirror speeds from cached hostfile
c6-cd/group_gz                                                        | 212 kB    00:00 ... 
Installed Groups: #已安装的包组
  Additional Development
  Base
  ... 
Installed Language Groups:  #已安装的语言包组
  Arabic Support [ar]
  ... 
Available Groups: #可安装的包组
  Backup Client
  ... 
Available Language Groups: #可安装的语言包组
  Afrikaans Support [af]
  ... 
Done

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/16345.html