linux源码安装 rpm命令

安装dhcp为例:

挂载光盘文件到/media目录

shell

mount /dev/sr0 /media

![](http://images2015.cnblogs.com/blog/1122851/201703/1122851-20170319145834057-716346386.png)
###打开/media目录下的Packages目录
```shell```
#cd /media/Packages

查看系统是否安装dhcp软件包

shell

rpm –qa | grep dhcp

![](http://images2015.cnblogs.com/blog/1122851/201703/1122851-20170319150442479-1613099939.png)
###安装dhcp软件包
```shell```
#rpm –ivh dhcp-4.2.5-47.e17.centos.x86_64.rpm

查看dhcp软件包的信息

shell

rpm –qi dhcp

![](http://images2015.cnblogs.com/blog/1122851/201703/1122851-20170319150751166-780097287.png)

###查看dhcp软件包中所包含的所有文件
```shell```
#rpm –ql dhcp

查看/bin/ls文件是由哪个软件包产生

shell

rpm –qf /bin/ls

![](http://images2015.cnblogs.com/blog/1122851/201703/1122851-20170319150814620-627019469.png)

###卸载dhcp软件包
```shell```
#rpm –e dhcp

posted @ 2017-03-19 15:09  六神酱  阅读(1363)  评论(0编辑  收藏  举报