rpm包的安装与卸载

  • Post author:
  • Post category:其他


#rpm

作用:管理rpm包

语法:rpm 【选项】 包名

rpm -ivh /

/Packages/

.rpm //安装rpm软件包

查看包的个数:

[root@localhost ~]# ls /mnt/Packages/ |wc -l

4621

[root@localhost Packages]# rpm -ivh /mnt/Packages/lrzsz-0.12.20-36.el7.x86_64.rpm

#i install安装

#v verbose详细

#h  hash安装时打印散列标记#号

安装时,解决依赖关系:

1、直接在Packages下找缺少的包

2、通过关键字找[root@localhost Packages]# ls

mysql


3、上rpm包相关的网站


http://rpmfind.net/



http://rpm.pbone.net/



http://www.rpmseek.com/index.html


强制安装:

[root@localhost Packages]# rpm -ivh –nodeps /mnt/Packages/lrzsz-0.12.20-36.el7.x86_64.rpm

rpm查询功能:

[root@localhost Packages]# rpm -ivh zsh-5.0.2-14.el7.x86_64.rpm

准备中…                          ################################# [100%]

正在升级/安装…

1:zsh-5.0.2-14.el7                 ################################# [100%]

[root@localhost Packages]#

[root@localhost Packages]# rpm -q zsh  #查看zsh是否安装

zsh-5.0.2-14.el7.x86_64

[root@localhost Packages]# rpm -qa  #查看所有安装的rpm包

[root@localhost Packages]# rpm -ql zsh | more  #查看zsh安装时生成了哪些文件

rpm -qf

which vi

//用于查看以安装应用的软件包全称,`为tab上方的反引号

“ //反引号的作用:linux执行时会先执行反引号中的命令

[root@localhost Packages]# rpm -qpl /mnt/Packages/zsh-5.0.2-14.el7.x86_64.rpm | more //预先查看此软件包会产生哪些路径

升级:

[root@localhost Packages]# rpm -Uvh /mnt/Packages/zsh-5.0.2-14.el7.x86_64.rpm

卸载:

[root@localhost Packages]# rpm -e zsh //–nodeps可以强制删除

[root@localhost Packages]# rpm -q zsh

未安装软件包 zsh

若有nokey提示,导入RPM-GPG-KEY安装rpm包是,对rpm进行验签

[root@localhost mnt]# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@localhost yum.repos.d]# rpm -qpi /mnt/Packages/zsh-5.0.2-14.el7.x86_64.rpm //查看包描述