centos7.4 rpm命令

rpm命令对系统的包进行管理:安装,删除,查询,更新等操作

1.查询

语法格式是:

  rpm {-q|--query} [select-options] [query-options]

select-options
[PACKAGE_NAME] [-a,--all] [-f,--file FILE]
[-g,--group GROUP] {-p,--package PACKAGE_FILE]
[--hdrid SHA1] [--pkgid MD5] [--tid TID]
[--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME]
[--whatprovides CAPABILITY] [--whatrequires CAPABILITY]

query-options
[--changelog] [-c,--configfiles] [--conflicts]
[-d,--docfiles] [--dump] [--filesbypkg] [-i,--info]
[--last] [-l,--list] [--obsoletes] [--provides]
[--qf,--queryformat QUERYFMT] [-R,--requires]
[--scripts] [-s,--state] [--triggers,--triggerscripts]

查询系统安装的所有包 rpm -qa

 

查询状态 rpm -qas

 

查询rpm包的信息:rpm -qai

 

  查询包的配置文件信息 rpm -qac

 

 

 

 2.安装使用-i参数

  rpm {-i|--install} [install-options] PACKAGE_FILE ...

安装rpm包的最常见组合式:rpm -ivh

 

 3.删除应用使用-e参数

rpm {-e|--erase} [--allmatches] [--justdb] [--nodeps] [--noscripts]
[--notriggers] [--test] PACKAGE_NAME ...

删除刚才安装的lrzsz

 

posted @ 2019-10-29 23:59  whyld  阅读(3516)  评论(0编辑  收藏  举报