rpm命令应用-程序员宅基地

技术标签: rpm卸载  Linux运维  rpm安装  rpm查看  L02-Linux命令  rpm  

记录:323

场景:在CentOS 7.9操作系统上,使用rpm命令安装、卸载、查看软件包。

版本:

操作系统:CentOS 7.9

名词:

RPM:Red-Hat Package Manager的简称。一个命令行驱动的软件包管理工具,用来安装、卸载、校验、查询和更新Linux系统上的软件包。它生成具有.rpm扩展名的文件。

命名规则:rpm包命名规则一般包括名称、版本、架构、和.rpm后缀。

1.rpm常用命令

(1)帮助命令

命令:rpm --help

功能:查看rpm 支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

(2)安装rpm包

安装指定包:rpm -ivh yum-utils-1.1.31-54.el7_8.noarch.rpm

安装指定包:rpm -ivh --nodeps yum-utils-1.1.31-54.el7_8.noarch.rpm

安装指定包:rpm -ivh --force yum-utils-1.1.31-54.el7_8.noarch.rpm

安装目录下全部包:rpm -ivh ./*

功能:安装指定软件包,-i是install安装;-v是打印详细日志;-h是在安装包时打印哈希标记,显示安装进度;--nodeps不校验依赖包;--force强制安装。

(3)卸载rpm包

卸载包命令:rpm -e yum-utils-1.1.31-54.el7_8

卸载包命令:rpm -e --nodeps yum-utils-1.1.31-54.el7_8

功能:卸载rpm包,-e是erase简写,就是清除卸载包;--nodeps,是代表不确认包的依赖。

(4)查看已安装的包

查询已安装的rpm包列表:rpm -qa

已安装包中的查询包含关键字的包:rpm -qa | grep yum-utils

(5)查看已安装包的信息

命令:rpm -qi yum-utils

功能:查看指定的已安装包的详细信息。比如包名称、版本、发行版本、架构、许可证、构建日期等。一般字段包括:Name、Version、Release、Architecture、InstallDate、Group、Size、License、Signature、SourceRPM、BuildDate、BuildHost、Relocations、Packager、Vendor、URL、Summary、Description。

(6)查看已安装包的文件

命令:rpm -ql yum-utils

功能:查看安装包的文件列表。

2.rpm命令和选项

命令:rpm --help

功能:查看rpm 支持全部命令和选项,在实际工作中,查看这个手册应该是必备之选。

Usage: rpm [OPTION...]

Query/Verify package selection options:
  -a, --all                        query/verify all packages
  -f, --file                       query/verify package(s) owning file
  -g, --group                      query/verify package(s) in group
  -p, --package                    query/verify a package file
  --pkgid                          query/verify package(s) with package identifier
  --hdrid                          query/verify package(s) with header identifier
  --triggeredby                    query the package(s) triggered by the package
  --whatrequires                   query/verify the package(s) which require a dependency
  --whatprovides                   query/verify the package(s) which provide a dependency
  --nomanifest                     do not process non-package files as manifests

Query options (with -q or --query):
  -c, --configfiles                list all configuration files
  -d, --docfiles                   list all documentation files
  -L, --licensefiles               list all license files
  --dump                           dump basic file information
  -l, --list                       list files in package
  --queryformat=QUERYFORMAT        use the following query format
  -s, --state                      display the states of the listed files

Verify options (with -V or --verify):
  --nofiledigest                   don't verify digest of files
  --nofiles                        don't verify files in package
  --nodeps                         don't verify package dependencies
  --noscript                       don't execute verify script(s)

Install/Upgrade/Erase options:
  --allfiles                       install all files, even configurations which might otherwise be skipped
  --allmatches                     remove all packages which match <package> (normally an error is generated if
                                   <package> specified multiple packages)
  --badreloc                       relocate files in non-relocatable package
  -e, --erase=<package>+           erase (uninstall) package
  --excludedocs                    do not install documentation
  --excludepath=<path>             skip files with leading component <path> 
  --force                          short hand for --replacepkgs --replacefiles
  -F, --freshen=<packagefile>+     upgrade package(s) if already installed
  -h, --hash                       print hash marks as package installs (good with -v)
  --ignorearch                     don't verify package architecture
  --ignoreos                       don't verify package operating system
  --ignoresize                     don't check disk space before installing
  -i, --install                    install package(s)
  --justdb                         update the database, but do not modify the filesystem
  --nodeps                         do not verify package dependencies
  --nofiledigest                   don't verify digest of files
  --nocontexts                     don't install file security contexts
  --noorder                        do not reorder package installation to satisfy dependencies
  --noscripts                      do not execute package scriptlet(s)
  --notriggers                     do not execute any scriptlet(s) triggered by this package
  --nocollections                  do not perform any collection actions
  --oldpackage                     upgrade to an old version of the package (--force on upgrades does this automatically)
  --percent                        print percentages as package installs
  --prefix=<dir>                   relocate the package to <dir>, if relocatable
  --relocate=<old>=<new>           relocate files from path <old> to <new>
  --replacefiles                   ignore file conflicts between packages
  --replacepkgs                    reinstall if the package is already present
  --test                           don't install, but tell if it would work or not
  -U, --upgrade=<packagefile>+     upgrade package(s)
  --reinstall=<packagefile>+       reinstall package(s)

Common options for all rpm modes and executables:
  -D, --define='MACRO EXPR'        define MACRO with value EXPR
  --undefine=MACRO                 undefine MACRO
  -E, --eval='EXPR'                print macro expansion of EXPR
  --macros=<FILE:...>              read <FILE:...> instead of default file(s)
  --noplugins                      don't enable any plugins
  --nodigest                       don't verify package digest(s)
  --nosignature                    don't verify package signature(s)
  --rcfile=<FILE:...>              read <FILE:...> instead of default file(s)
  -r, --root=ROOT                  use ROOT as top level directory (default: "/")
  --dbpath=DIRECTORY               use database in DIRECTORY
  --querytags                      display known query tags
  --showrc                         display final rpmrc and macro configuration
  --quiet                          provide less detailed output
  -v, --verbose                    provide more detailed output
  --version                        print the version of rpm being used

Options implemented via popt alias/exec:
  --scripts                        list install/erase scriptlets from package(s)
  --setperms                       set permissions of files in a package
  --setugids                       set user/group ownership of files in a package
  --setcaps                        set capabilities of files in a package
  --restore                        restore file/directory permissions
  --conflicts                      list capabilities this package conflicts with
  --obsoletes                      list other packages removed by installing this package
  --provides                       list capabilities that this package provides
  --requires                       list capabilities required by package(s)
  --info                           list descriptive information from package(s)
  --changelog                      list change logs for this package
  --xml                            list metadata in xml
  --triggers                       list trigger scriptlets from package(s)
  --last                           list package(s) by install time, most recent first
  --dupes                          list duplicated packages
  --filesbypkg                     list all files from each package
  --fileclass                      list file names with classes
  --filecolor                      list file names with colors
  --fscontext                      list file names with security context from file system
  --fileprovide                    list file names with provides
  --filerequire                    list file names with requires
  --filecaps                       list file names with POSIX1.e capabilities

Help options:
  -?, --help                       Show this help message
  --usage                          Display brief usage message

以上,感谢。

2022年11月19日

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/zhangbeizhen18/article/details/127938380

智能推荐

【Android开发--新手必看篇】GridView 网格视图_调整verticalgridview之间的间隔-程序员宅基地

文章浏览阅读189次。Android笔记​ ——高级控件之GridView【若对该知识点有更多想了解的,欢迎私信博主~~】GridView一:使用​ 在Activity布局文件中放置GridView控件<?xml version="1.0" encoding="utf-8"?><LinearLayout ="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.andr_调整verticalgridview之间的间隔

Netty学习笔记五:Netty源码分析_netty 源码学习-程序员宅基地

文章浏览阅读322次。Netty学习笔记五:Netty源码分析EventLoop和EventLoopGroup线程模型高性能RPC框架3个要素一、IO模型(五种IO模型)二、数据协议(http/protobuf/Thrift)三、线程模型(主从线程组模型)EventLoopEventLoop好比一个线程,1个EventLoop可以服务多个Channel,一个Channel只有一个EventL..._netty 源码学习

Kyligence 发布数据和分析领域垂直大模型司南(Compass)_司南模型怎么测试-程序员宅基地

文章浏览阅读140次。12 月 19 日,跬智信息(Kyligence)正式发布数据和分析领域垂直大模型司南(Compass)(以下简称“司南大模型”)。基于多年数据和分析领域的实践积累和全行业指标洞察的海量语料,Kyligence司南大模型已具备自然语言对话分析、指标搜索与推荐、自动化数据洞察、KPI 评估、智能决策建议等核心能力。_司南模型怎么测试

MySQL数据库Insert语句慢SQL处理-程序员宅基地

文章浏览阅读3.8k次。#问题描述insert into …普通的插入语句,经常出现耗时2s以上#数据状态1.表数据量大,每天产生200万条数据2.高并发插入#问题解决1.由于表中数据量庞大,建议数据归档处理,冷热处理2.表中有过多索引,当数据insert时,索引会重排产生太多的io操作。导致缓慢,有必然要的只保留主键。3.表的数据库引擎,默认InnerDB,若数据不重要,可以使用MyISAM......

EasyDarwin开源流媒体云平台之EasyRMS录播服务器功能设计_开源录播系统-程序员宅基地

文章浏览阅读3.6k次。需求背景EasyDarwin开发团队维护EasyDarwin开源流媒体服务器也已经很多年了,之前也陆陆续续尝试过很多种服务端录像的方案,有:在EasyDarwin中直接解析收到的RTP包,重新组包录像;也有:在EasyDarwin中新增一个RecordModule,再以RTSPClient的方式请求127.0.0.1自己的直播流录像,但这些始终都没有成气候;我们的想法是能够让整套EasyDarwin_开源录播系统

oracle Plsql 执行update或者delete时卡死问题解决办法_oracle delete update 锁表问题-程序员宅基地

文章浏览阅读1.1w次。今天碰到一个执行语句等了半天没有执行:delete table XXX where ......,但是在select 的时候没问题。后来发现是在执行select * from XXX for update 的时候没有commit,oracle将该记录锁住了。可以通过以下办法解决: 先查询锁定记录 Sql代码 SELECT s.sid, s.seri_oracle delete update 锁表问题

随便推点

java-php-python-ssm社区志愿者服务管理系统计算机毕业设计_社区 志愿服务系统源码 php-程序员宅基地

文章浏览阅读453次。java-php-python-ssm社区志愿者服务管理系统计算机毕业设计。springboot基于微服务架构的图书借阅系统的设计与实现。JSP酒店餐饮管理系统的设计与实现sqlserver。ssm基于JavaWeb的网上购书后台管理系统。ssm基于Vue.js的音乐播放器设计与实现。ssm基于SSM框架的在线健康系统设计与实现。springboot培训机构的人员管理系统。_社区 志愿服务系统源码 php

java/php/node.js/python病人跟踪治疗信息管理系统【2024年毕设】-程序员宅基地

文章浏览阅读21次。springboot基于springbootvue框架的零售店记账系统。springboot基于微信小程序的游戏账号交易系统。springboot基于Android的疫情信息系统。springboot微信小程序的健康体检预约系统。ssm基于微信小程序的汽车共享充电桩预约系统。jsp基于JavaWeb的B2C电商商城系统。ssm基于JavaWeb的班级量化评比系统。ssm基于Android的编程语言学习系统。ssm基于微信小程序的古诗词学习与推广系统。springboot电子银行业务办理系统。

空间数据引擎oracle_空间数据库引擎及其解决方案分析-程序员宅基地

文章浏览阅读350次。4WWW.GWN.COM.CN地理信息世界GEOMATICSWORLD技术应用0引言地理信息系统(GIS)以空间数据为研究对象,在实现对空间数据存储和操作的基础上进行空间分析和应用。以往受关系数据库不支持空间数据管理的限制,传统的GIS软件采用分离的方式管理数据,即空间数据采用文件形式和目录结构,属性数据由内置的关系型数据库进行管理。分离体系结构造成空间数据管理效率低下,无法获得数据库系统的有效支..._oracle空间数据库引擎

java发布rest服务器,使用Java restlet发布到服务器-程序员宅基地

文章浏览阅读177次。我正在尝试使用restlet向服务器发布JSONO对象。当我尝试使用POSTMAN发布它可以发布,但是当我尝试从使用restlet的java代码发布时,我得到一个错误:Unable to find a converter for this objectand Bad Request (400) - The request could not be understood by the server ..._触发 org.restlet.resource.resourceexception

使用flex-wrap实现弹性盒自动换行-程序员宅基地

文章浏览阅读2w次,点赞6次,收藏10次。布局的时候,我们常常会需要一行排列3/4/5/6个盒子,必要时自动换行,这时可以借助CSS3中的flex-wrap属性。flex-wrap: nowrap|wrap|wrap-reverse|initial|inherit;nowrap为默认值,wrap必要时实现自动换行,reverse必要时换行并反向排列关键是在父元素中设置flex-wrap值为wrap, 然后是设置子元素的wi...

改变Android Studio的背景background_as怎么设置背景-程序员宅基地

文章浏览阅读2.7k次,点赞2次,收藏5次。改变Android Studio的背景background我们先点File然后再点Settings里的Appearance,点击Theme换成Darcula 把白色换成黑色,这样的好处是换成background是图片比较清晰。此处正式开始AS换背景这里我们颜色从白色换成了黑色,先点File里Settings的Appearance然后点background image把你喜欢的图片放进去(图片放在D盘自己新建的文件)..._as怎么设置背景