RPM介绍
RPM是已经编译好的软件安装库。编译是有相应环境相适应的,包括系统,版本等相关信息都要跟编译版本一致才行,否则肯定会出现安装不成功的情况,强制安装的话,也会出现各种各样的问题。
在这种情况下,就出现了SRPM的格式,带源码的安装库文件。
RPM和SRPM的相关区别,如下图
YUM原理图
rpm使用详解
强制安装
同理,如果要安装U盘中的软件,也需要如此来进行操作
RPM 升级与更新
RPM查询软件是否安装
[root@localhost ~]# rpm -q lograotate 未安装软件包 lograotate [root@localhost ~]# rpm -q logrotate logrotate-3.8.6-17.el7.x86_64 [root@localhost ~]# rpm -q logrotating 未安装软件包 logrotating [root@localhost ~]# rpm -ql logrotate /etc/cron.daily/logrotate /etc/logrotate.conf /etc/logrotate.d /etc/rwtab.d/logrotate /usr/sbin/logrotate /usr/share/doc/logrotate-3.8.6 /usr/share/doc/logrotate-3.8.6/CHANGES /usr/share/doc/logrotate-3.8.6/COPYING /usr/share/man/man5/logrotate.conf.5.gz /usr/share/man/man8/logrotate.8.gz /var/lib/logrotate /var/lib/logrotate/logrotate.status [root@localhost ~]# rpm -q perl #不需要将全称都输入。我一开始查询的时候一大堆软件,而且名称很长,这样看,只需要将软件名进行查询就可以查询到软件的相关信息 perl-5.16.3-293.el7.x86_64
[root@localhost ~]# rpm -qi perl
Name : perl #软件名称
Epoch : 4
Version : 5.16.3 #软件的版本
Release : 293.el7 #释出的版本
Architecture: x86_64 #编译针对的系统信息
Install Date: 2019年08月19日 星期一 11时01分30秒 #安装日期
Group : Development/Languages #软件是放在哪一个群组中
Size : 23552029 #大小
License : (GPL+ or Artistic) and (GPLv2+ or Artistic) and Copyright Only and MIT and Public Domain and UCD #授权方式
Signature : RSA/SHA256, 2018年11月12日 星期一 22时43分53秒, Key ID 24c6a8a7f4a80eb5
Source RPM : perl-5.16.3-293.el7.src.rpm #SRPM的文档名 就是这个source源码
Build Date : 2018年10月31日 星期三 03时03分24秒 #打包时间
Build Host : x86-01.bsys.centos.org #打包主机
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : http://www.perl.org/
Summary : Practical Extraction and Report Language
Description : #详细信息
Perl is a high-level programming language with roots in C, sed, awk and shell
scripting. Perl is good at handling processes and files, and is especially
good at handling text. Perl‘s hallmarks are practicality and efficiency.
While it is used to do a lot of different things, Perl‘s most common
applications are system administration utilities and web programming. A large
proportion of the CGI scripts on the web are written in Perl. You need the
perl package installed on your system so that your system can handle Perl
scripts.
Install this package if you want to program in Perl or enable your system to
handle Perl scripts.
注意,查询某个软件是否安装,只需要输入软件名就可以,因为它已在 /var/lib/rpm数据库中存在。但是如果要查询RPM文件,就必须输入全名才能查得到。这点要注意
[root@localhost ~]# rpm -qa | grep ^c | wc-l bash: wc-l: 未找到命令... [root@localhost ~]# rpm -qa | grep ^c | wc-1 bash: wc-1: 未找到命令... [root@localhost ~]# rpm -qa | grep ^c | wc -l 84 [root@localhost ~]# rpm -qf /etc/crontab crontabs-1.11-6.20121102git.el7.noarch
RPM 验证与数字签名
详解
原文:https://www.cnblogs.com/Lonelychampion/p/11535699.html