rpm包的管理

RPM是RedHat Package Manager的缩写,是Linux系统中广泛采用的软件包管理工具。本文详细介绍了如何在不同Linux发行版上安装、升级和卸载RPM包,帮助用户有效管理他们的系统。
摘要由CSDN通过智能技术生成

        RPM是RedHat Package Manager(RedHat软件包管理工具)的缩写,这一文件格式名称虽然打上了RedHat的标志,但是其原始设计理念是开放式的,现在包括OpenLinux、S.u.S.E.以及Turbo Linux等Linux的分发版本都有采用,可以算是公认的行业标准了。


        本文讲解如何管理RPM包。


#安装:i:install v:view h:进度条
[root@serv01 Packages]# rpm -ivh mysql-5.1.52-1.el6_0.1.x86_64.rpm i:install v:view进度条

#rpm -qa query all
#查看mysql-server安装包
[root@serv01 Packages]# rpm -qa | grep mysql-server
mysql-server-5.1.52-1.el6_0.1.x86_64

#查看mysql-server安装包生成的文件 l:list
[root@serv01 Packages]# rpm -ql mysql-server
/etc/rc.d/init.d/mysqld
#其余文件略
/usr/share/mysql/mysql_test_data_timezone.sql
/var/lib/mysql
/var/log/mysqld.log
/var/run/mysqld


#查看安装包生成的文件属于哪个安装包
[root@serv01 ~]# ls /usr/share/mysql/my-medium.cnf
/usr/share/mysql/my-medium.cnf
[root@serv01 ~]# rpm -qf /usr/share/mysql/my-medium.cnf
mysql-server-5.1.52-1.el6_0.1.x86_64

#查看mysql-server安装包的详细信息
[root@serv01 ~]# rpm -qi mysql-server
Name        : mysql-server                 Relocations: (not relocatable)
Version     : 5.1.52                            Vendor: Red Hat, Inc.
Release     : 1.el6_0.1                     Build Date: Tue 21 Dec 2010 02:56:53 AM CST
Install Date: Sat 27 Jul 2013 12:39:09 AM CST      Build Host: x86-006.build.bos.redhat.com
Group       : Applications/Databases        Source RPM: mysql-5.1.52-1.el6_0.1.src.rpm
Size        : 24481725                         License: GPLv2 with exceptions
Signature   : RSA/8, Mon 17 Jan 2011 09:48:19 PM CST, Key ID 199e2f91fd431d51
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://www.mysql.com
Summary     : The MySQL server and related files
Description :
MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
client/server implementation consisting of a server daemon (mysqld)
and many different client programs and libraries. This package contains
the MySQL server and some accompanying files and directories.

[root@serv01 Packages]# rpm --help
Usage: rpm [OPTION...]
  --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                         initi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值