rpm queries rpm -qa/c/d rpm -q --scripts httpd yum localinstall

[root@localhost yum.repos.d]# which chronyd
/sbin/chronyd

[root@localhost yum.repos.d]# rpm -qf /sbin/chronyd
chrony-2.1.1-4.el7.centos.x86_64

show package files
[root@localhost yum.repos.d]# rpm -ql chrony
/etc/NetworkManager/dispatcher.d/20-chrony
/etc/chrony.conf
/etc/chrony.keys
/etc/dhcp/dhclient.d/chrony.sh
/etc/logrotate.d/chrony
/usr/bin/chronyc
/usr/lib/systemd/ntp-units.d/50-chronyd.list
/usr/lib/systemd/system/chrony-dnssrv@.service
/usr/lib/systemd/system/chrony-dnssrv@.timer
/usr/lib/systemd/system/chrony-wait.service
/usr/lib/systemd/system/chronyd.service
/usr/libexec/chrony-helper
/usr/sbin/chronyd
/usr/share/doc/chrony-2.1.1
/usr/share/doc/chrony-2.1.1/COPYING
/usr/share/doc/chrony-2.1.1/FAQ
/usr/share/doc/chrony-2.1.1/NEWS
/usr/share/doc/chrony-2.1.1/README
/usr/share/doc/chrony-2.1.1/chrony.txt.gz
/usr/share/info/chrony.info.gz
/usr/share/man/man1/chronyc.1.gz
/usr/share/man/man5/chrony.conf.5.gz
/usr/share/man/man8/chronyd.8.gz
/var/lib/chrony
/var/lib/chrony/drift
/var/lib/chrony/rtc
/var/log/chrony
[root@localhost yum.repos.d]#

show only configuration files
[root@localhost yum.repos.d]# rpm -qc chrony
/etc/chrony.conf
/etc/chrony.keys
/etc/logrotate.d/chrony

show documentation
[root@localhost yum.repos.d]# rpm -qd chrony
/usr/share/doc/chrony-2.1.1/COPYING
/usr/share/doc/chrony-2.1.1/FAQ
/usr/share/doc/chrony-2.1.1/NEWS
/usr/share/doc/chrony-2.1.1/README
/usr/share/doc/chrony-2.1.1/chrony.txt.gz
/usr/share/info/chrony.info.gz
/usr/share/man/man1/chronyc.1.gz
/usr/share/man/man5/chrony.conf.5.gz
/usr/share/man/man8/chronyd.8.gz
[root@localhost yum.repos.d]# 

rpm -qa #query installed packages

check which version of httpd installed
[root@localhost yum.repos.d]# rpm -qa | grep http
httpd-tools-2.4.6-45.el7.centos.x86_64
httpd-2.4.6-45.el7.centos.x86_64

=======================
query installation scripts
before installation for security reasons it's required to check installation scripts.


[root@localhost yum.repos.d]# rpm -q --scripts httpd
preinstall scriptlet (using /bin/sh):
# Add the "apache" group and user
/usr/sbin/groupadd -g 48 -r apache 2> /dev/null || :
/usr/sbin/useradd -c "Apache" -u 48 -g 48 \
        -s /sbin/nologin -r -d /usr/share/httpd apache 2> /dev/null || :
postinstall scriptlet (using /bin/sh):

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        systemctl preset httpd.service htcacheclean.service >/dev/null 2>&1 || : 
fi
preuninstall scriptlet (using /bin/sh):

if [ $1 -eq 0 ] ; then 
        # Package removal, not upgrade 
        systemctl --no-reload disable httpd.service htcacheclean.service > /dev/null 2>&1 || : 
        systemctl stop httpd.service htcacheclean.service > /dev/null 2>&1 || : 
fi
postuninstall scriptlet (using /bin/sh):

systemctl daemon-reload >/dev/null 2>&1 || : 


# Trigger for conversion from SysV, per guidelines at:
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
posttrans scriptlet (using /bin/sh):
test -f /etc/sysconfig/httpd-disable-posttrans || \
  /bin/systemctl try-restart httpd.service htcacheclean.service >/dev/null 2>&1 || :
[root@localhost yum.repos.d]# 

===================
[root@localhost yum.repos.d]# rpm -ql tomcat-7.0.69-10.el7.noarch.rpm
package tomcat-7.0.69-10.el7.noarch.rpm is not installed

#show scripts
rpm -qp --scripts package.rpm

===================
yum localinstall - install package in current directory

[root@localhost yum.repos.d]# cd /repo/
[root@localhost repo]# ll
total 960
-rw-r--r-- 1 root root 881948 Jan 31 10:59 nginx-1.10.3-1.el6.ngx.x86_64.rpm
drwxr-xr-x 2 root root   4096 Jun 24 16:19 repodata
-rw-r--r-- 1 root root  90548 Jun 24 15:56 tomcat-7.0.69-10.el7.noarch.rpm
[root@localhost repo]# yum localinstall tomcat
Loaded plugins: fastestmirror, langpacks
Skipping: tomcat, filename does not end in .rpm.
Nothing to do
[root@localhost repo]# yum localinstall tomcat-7.0.69-10.el7.noarch.rpm 
Loaded plugins: fastestmirror, langpacks
Examining tomcat-7.0.69-10.el7.noarch.rpm: tomcat-7.0.69-10.el7.noarch
=================





Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all