yum

1、安装

[root@localhost ~]# yum install php53        #安装php5.3 
[root@localhost ~]# yum groupinstall "MySQL Server"    #安装mysql数据库组 

2、更新和升级

[root@localhost ~]# yum update              #全部更新 
[root@localhost ~]# yum update  php53       #更新php 
[root@localhost ~]# yum check-update        #检查可更新的程序 [root@localhost ~]# yum upgrade php53       #升级php53 
[root@localhost ~]# yum groupupdate "MySQL Server"    #升级mysql服务组 

3、查找和显示

[root@localhost ~]# yum info php53          #查看php53的安装信息 [root@localhost ~]# yum list                #列出所有可安装的程序包 [root@localhost ~]# yum list php53         #列出所有php53的程序包 [root@localhost ~]# yum groupinfo "MySQL Server"    #查看mysql服务组的,相关安装包 
[root@localhost ~]# yum deplist php53      #查看php53依赖情况 

4、删除

[root@localhost ~]# yum remove php53          #删除php53 
[root@localhost ~]# yum groupremove "MySQL Server"    #删除mysql服务组 

5、清除缓存

[root@localhost ~]# yum clean packages            #清除缓存目录下的软件包 [root@localhost ~]# yum clean headers             #清除缓存目录下的 headers 
[root@localhost ~]# yum clean oldheaders          #清除缓存目录下旧的 headers 
[root@localhost ~]# yum clean, yum clean all      #清除所有 

6、搜索安装包

 yum search iftop  #搜索安装包 

7、查看历史记录

root@localhost ~]# yum history  #查看历史记录,然后根据Id可以用undo撤销指定的yum操作 
Loaded plugins: fastestmirror, priorities, security 
ID     | Login user               | Date and time    | Action(s)      | Altered -------------------------------------------------------------------------------     12 | root               | 2016-04-29 15:01 | Install        |    1        11 | root               | 2016-04-29 14:54 | O, U           |    3        10 | root               | 2016-01-11 14:44 | Install        |    1         9 | root               | 2015-12-29 10:06 | Install        |    1  <      8 | root               | 2015-06-01 19:02 | Install        |   10 >       7 | root               | 2015-06-01 18:46 | Install        |    1         6 | root               | 2015-06-01 17:38 | Install        |    1         5 | root               | 2015-06-01 17:32 | I, U           |   21         4 | root               | 2015-06-01 17:19 | I, U           |   33         3 | root               | 2015-06-01 17:16 | I, U           |   64         2 | root               | 2015-06-01 17:14 | Install        |    1  <      1 | System            | 2015-06-01 16:10 | Install        |  776 >  

8、生成缓存

[root@localhost ~]#  yum makecache     #生成缓存 

9、查看某个命令在哪个包

[root@localhost ~]# yum  provides */rz  
已加载插件:fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile local/filelists_db                                                                                                                                                      | 6.3 MB     00:00 ...  
lrzsz-0.12.20-27.1.el6.x86_64 : The lrz and lsz modem communications programs 
Repo        : local 
匹配来自于: 
Filename    : /usr/bin/rz 

发表评论

登录... 后才能评论