*Linux之rpm命令
在Linux操作系统中,有一个系统软件包,它的功能类似于Windows里面的“添加/删除程序”,但是功能又比"添加/删除程序"强很多,它就是Red Hat Package Manager(简称RPM)。
先放一个大招,哈哈
[root@winner ~]# rpm --help
用法: rpm [选项...]
--quiet 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
-W, --ftswalk query/verify package(s) from TOP file tree
walk
--pkgid query/verify package(s) with package
identifier
--hdrid query/verify package(s) with header
identifier
--fileid query/verify package(s) with file identifier
--specfile query a spec file
--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
--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
--nomd5 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)
File tree walk options (with --ftswalk):
--comfollow follow command line symlinks
--logical logical walk
--nochdir don't change directories
--nostat don't get stat info
--physical physical walk
--seedot return dot and dot-dot
--xdev don't cross devices
--whiteout return whiteout information Signature options:
--addsign sign package(s) (identical to --resign)
-K, --checksig verify package signature(s)
--delsign delete package signatures
--import import an armored public key
--resign sign package(s) (identical to --addsign)
--nodigest don't verify package digest(s)
--nosignature don't verify package signature(s)
Database options:
--initdb initialize database
--rebuilddb rebuild database inverted lists from
installed package headers Install/Upgrade/Erase options:
--aid add suggested packages to transaction
--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>
--fileconflicts detect file conflicts between packages
--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
--nomd5 don't verify digest of files (obsolete)
--nocontexts don't install file security contexts
--noorder do not reorder package installation to
satisfy dependencies
--nosuggest do not suggest missing dependency
resolution(s)
--noscripts do not execute package scriptlet(s)
--notriggers do not execute any scriptlet(s) triggered
by this package
--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) Common options for all rpm modes and executables:
-D, --define='MACRO EXPR' define MACRO with value EXPR
-E, --eval='EXPR' print macro expansion of EXPR
--macros=<FILE:...> read <FILE:...> instead of default file(s)
--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:
"/")
--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
--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
RPM 安装操作
命令:
rpm -i 需要安装的包文件名
举例如下:
rpm -i example.rpm 安装 example.rpm 包; rpm -iv example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息; rpm -ivh example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息及安装进度;
RPM 查询操作
命令:
rpm -q …
附加查询命令:
a
查询所有已经安装的包以下两个附加命令用于查询安装包的信息;
i
显示安装包的信息;
l
显示安装包中的所有文件被安装到哪些目录下;
s
显示安装版中的所有文件状态及被安装到哪些目录下;以下两个附加命令用于指定需要查询的是安装包还是已安装后的文件;
p
查询的是安装包的信息;
f
查询的是已安装的某文件信息;
举例如下:
rpm -qa | grep tomcat4 查看 tomcat4 是否被安装; rpm -qip example.rpm 查看 example.rpm 安装包的信息; rpm -qif /bin/df 查看/bin/df 文件所在安装包的信息; rpm -qlf /bin/df 查看/bin/df 文件所在安装包中的各个文件分别被安装到哪个目录下;
RPM 卸载操作
命令:
rpm -e 需要卸载的安装包
在卸载之前,通常需要使用rpm -q …
命令查出需要卸载的安装包名称。
举例如下:
rpm -e tomcat4 卸载 tomcat4 软件包
RPM 升级操作
命令:
rpm -U 需要升级的包
举例如下:
rpm -Uvh example.rpm 升级 example.rpm 软件包
RPM 验证操作
命令:
rpm -V 需要验证的包
举例如下:
rpm -Vf /etc/tomcat4/tomcat4.conf
输出信息类似如下:
S.5....T c /etc/tomcat4/tomcat4.conf
其中,S 表示文件大小修改过,T 表示文件日期修改过。限于篇幅,更多的验证信息请您参考rpm 帮助文件:man rpm
RPM 的其他附加命令
--force 强制操作 如强制安装删除等; --requires 显示该包的依赖关系; --nodeps 忽略依赖关系并继续操作
*Linux之rpm命令的更多相关文章
- linux 软件包 rpm命令之安装、更新、卸载、依赖
软件包分类1.源码包2.二进制包二进制包是源码包编译后产生的文件..exe文件是适用于windows平台的二进制包:RPM包适用于redhat系列的二进制包:deb包是适用于ubuntu平台的二进制包 ...
- Linux下面rpm命令和mount命令详解
在Linux下面我们经常会安装一些软件包,还有挂载命令.接下来,我们通过一些实例来演示这些命令的使用.. 第一步:我们先在linux下面挂载光盘,先进入到根目录,然后切换到根下面的/mnt目录,因为/ ...
- Linux中rpm命令用法听语音
rpm 是红帽(RedHat)软件包管理工具,实现类似于 Windows 中的添加/删除程序功能.下面,就来向大家介绍 rpm 命令的用法. 工具/原料 CentOS 一.rpm常用参数 1 rpm ...
- Linux系统——rpm命令
(1)查看操作系统名字.版本cat /etc/redhat-release 查看系统内核kernel的版本号uname -r查看操作系统位数uname -m (2)rpm命令rpm 参数 软件名-q ...
- Linux功能-RPM命令详解
一.概述 RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序”,用RPM包方式来发布软件变得越来越流行,主要的原因是这种软件发布 ...
- linux的rpm命令
rpm 执行安装包二进制包(Binary)以及源代码包(Source)两种.二进制包可以直接安装在计算机中,而源代码包将会由 RPM自动编译.安装.源代码包经常以src.rpm作为后缀名. 常用命令组 ...
- Linux中rpm命令用法
rpm -ivh 软件包名 安装软件包并显示安装进度.这个是用得最多的了. rpm -qa 查询已经安装哪些软件包. rpm -q 软件包名 查询指定软件包是否已经安装. rpm -Uvh 软件包名 ...
- linux中不小心将rpm命令卸载了,怎么恢复?
今天在搭建mysql的集群服务时,安装mysql集群服务前,先卸载原来mysql的软件包,不小心将rpm的命令也给卸载掉了,这下惨了,什么也做不了了.在google了翻了好多个页面,甚至官网也看了,没 ...
- Linux rpm 命令参数使用详解[介绍和应用]
RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序” rpm 执行安装包 二进制包(Binary)以及源代码包(Source)两 ...
随机推荐
- Configure Database Mirroring
使用证书配置的镜像基本安装微软次序做就可以了 http://msdn.microsoft.com/zh-cn/library/ms191140.aspx 备份还原首先要转换成完全备份模式没什么好多说的 ...
- java抽象类和接口详解
接口和内部类为我们提供了一种将接口与实现分离的更加结构化的方法. 抽象类与接口是java语言中对抽象概念进行定义的两种机制,正是由于他们的存在才赋予java强大的面向对象的能力.他们两者之间对抽象概念 ...
- andriod
谷歌提供的安卓源码中,网址如下:http://androidxref.com http://blog.csdn.net/zoe6553/article/details/6622258
- iOS多线程GCD 研究
Grand Central Dispatch (GCD)是Apple开发的一个多核编程的解决方法. dispatch queue分成以下三种: 1)运行在主线程的Main queue,通过dispat ...
- C#中DataTable与实体集合通用转换(使用扩展方法)
本案例提供了:把DataRow转换为单个实体.dataTable转换为List泛型支持时间格式转换. 下文的方法都是扩展方法.扩展方法要求写在静态类中,方法也要静态. 它必须在一个非嵌套.非泛型的静态 ...
- 模仿开发H5游戏,看你有多色
开发记录 前言 之前跟着慕课网学习开发H5小游戏开心鱼,勾起我的兴趣. 在写代码的过程中,不怎么会遇到问题.虽然代码是亲手敲出来的,但是由于并没有对游戏的整体思路,所以并不知道开发与优化的过程. 为了 ...
- sqlserver oracle 时间加减
sqlserver: 减去10小时: dateadd(hour,-10,Your_date) oracle : 减去10小时: sysdate()-10/24
- linux下php多版本的并存实现
其实最简单的方法,就是通过nginx,生成多个php使用不同的端口,这实在简单,我写了两个版本,一个是apche服务,一个是nginx服务,使用一两个不同的版本,爽!
- 【BZOJ】【1391】【CEOI2008】order
网络流/最小割 暴力建图就好了……S->i 容量为收益,i->j+n 容量为租金,j+n->T容量为购买所花的钱. 如果亏钱的话那么割掉的就是收益,表示不赚钱. 如果租金大于购买所花 ...
- 【POJ】【2975】Nim
博弈论 我哭……思路错误WA了6次?(好像还有手抖点错……) 本题是要求Nim游戏的第一步必胜策略有几种. 一开始我想:先全部异或起来得到ans,从每个比ans大的堆里取走ans个即可,答案如此累计… ...