Distribuições derivadas do Red Hat utilizam pacotes no formato RPM (Red Hat Package Manager), veja alguns exemplos de utilização do comando “rpm“, comando utilizado para gerenciar pacotes no formato “*.rpm“.
1-) Listando pacotes instalados:
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@srv-centos ~]# rpm -qa shadow-utils-4.1.5.1-24.el7.x86_64 python-libs-2.7.5-58.el7.x86_64 libblkid-2.23.2-43.el7_4.2.x86_64 glib2-2.50.3-3.el7.x86_64 procps-ng-3.3.10-16.el7.x86_64 fipscheck-1.4.1-6.el7.x86_64 libssh2-1.4.3-10.el7_2.1.x86_64 libtirpc-0.2.4-0.10.el7.x86_64 nss-sysinit-3.28.4-15.el7_4.x86_64 nss-tools-3.28.4-15.el7_4.x86_64 ... |
2-) Obtendo informações de um pacote:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[root@srv-centos ~]# rpm -qi iptables-1.4.21 Name : iptables Version : 1.4.21 Release : 18.3.el7_4 Architecture: x86_64 Install Date: Thu 15 Mar 2018 07:52:20 PM -03 Group : System Environment/Base Size : 1556341 License : GPLv2 Signature : RSA/SHA256, Thu 08 Mar 2018 11:20:29 AM -03, Key ID 24c6a8a7f4a80eb5 Source RPM : iptables-1.4.21-18.3.el7_4.src.rpm Build Date : Wed 07 Mar 2018 10:24:48 AM -03 Build Host : x86-01.bsys.centos.org Relocations : (not relocatable) Packager : CentOS BuildSystem <http://bugs.centos.org> Vendor : CentOS URL : http://www.netfilter.org/ Summary : Tools for managing Linux kernel packet filtering capabilities Description : The iptables utility controls the network packet filtering code in the Linux kernel. If you need to set up firewalls and/or IP masquerading, you should install this package. [root@srv-centos ~]# |
3-) Saber quais arquivos de configuração estão associados à um pacote:
1 2 3 4 |
[root@srv-centos ~]# rpm -qc iptables-1.4.21 /etc/sysconfig/ip6tables-config /etc/sysconfig/iptables-config [root@srv-centos ~]# |
4-) Identificar qual pacote instalou determinado arquivo:
1 2 3 |
[root@srv-centos ~]# rpm -qf /etc/centos-release centos-release-7-4.1708.el7.centos.x86_64 [root@srv-centos ~]# |
5-) Listando pacotes instalados recentemente:
1 2 3 4 5 6 7 8 9 10 11 |
[root@srv-centos ~]# rpm -qa --last | head tzdata-2018d-1.el7.noarch Thu Mar 29 07:13:15 2018 openssl-1.0.2k-8.el7.x86_64 Tue Mar 27 16:48:54 2018 nginx-1.12.2-1.el7_4.ngx.x86_64 Tue Mar 27 16:48:54 2018 make-3.82-23.el7.x86_64 Tue Mar 27 16:48:54 2018 lsof-4.87-4.el7.x86_64 Mon Mar 26 10:37:25 2018 mod_security_crs-2.2.9-1.el7.noarch Mon Mar 26 10:34:29 2018 mod_security-2.7.3-5.el7.x86_64 Mon Mar 26 10:34:21 2018 nmap-6.40-7.el7.x86_64 Mon Mar 26 09:27:37 2018 nmap-ncat-6.40-7.el7.x86_64 Mon Mar 26 09:27:36 2018 libpcap-1.5.3-9.el7.x86_64 |
Espero que seja útil, ate a próxima. 😉