linux|rpm命令安装软件包
2018-01-24 本文已影响45人
明明德撩码
1、cd配置centos的ISO文件

2、挂载cdrom
[root@localhost Packages]# mount /dev/cdrom /media
3、利用wc统计一下rpm按照包的个数

查看某文件是否安装
[root@localhost Packages]# rpm -qa | grep yp-tools
image.png
参数说明: -q 表示查询 --query
-a --all
-f,--file FILE
查询结果为空表示此文件没有安装。
安装zsh-4.3.10-5.el6.x86_64.rpm 文件

参数说明:
-i --install
-v Print lots of ugly debugging information.
查看安装
rpm -qa | grep zsh
-q query
-a all
"zsh" 表示部分安装包名。
image.png
卸载安装包
rpm -e zsh-4.3.10-5.el6.x86_64
-e erase 擦除

查询安装文件属于哪个安装包
rpm -qf /etc/ntp.conf
-q --query
-f --file

总结
