RPM

 

* rpm -qa      : alle geinstalleerde packages weergeven

* rpm -qf /dir/file     : geeft weer wat het geinstalleerde package is op basis van de /dir/file

 vb. rpm -qf /etc/init.d/tomcat5
 tomcat5-5.5.23-0jpp.7.el5

Onderstaande RPM commandos vereisen dat de cursor zich in het path van de packages bevinden.
============================================================================================
* rpm -qpR  java

* rpm -qpi vnc-server-4.0-0.beta4.3.2.i386.rpm

 By running the above command all the information about the package will be printed on screen.
 When using "-p" query parameter RPM knows that it's treating a file, in this case the VNC RPM package.
 Note that the "-i" parameter here is used in "Query Mode", it's not the install one.
 
* rpm -pql java-1.5.0-sun-devel-1.5.0.17-1jpp.2.el5.i586.rpm
 
 So you can list the files that are installed by a RPM package.
 This is usefull when you have to verify the contents of a package, execute the following on the shell to see the contents of the installed package "cpp":

* rpm -ql "................" -> lists
 
vb.
 
[root@P-DBS1 init.d]# rpm -qa *tomcat5*
tomcat5-5.5.23-0jpp.7.el5

[root@P-DBS1 init.d]# rpm -q tomcat5-5.5.23-0jpp.7.el5 -c
/etc/logrotate.d/tomcat5
/etc/sysconfig/tomcat5
/etc/tomcat5/catalina.policy
/etc/tomcat5/catalina.properties
/etc/tomcat5/context.xml
/etc/tomcat5/jk2.manifest
/etc/tomcat5/jk2.properties
/etc/tomcat5/jkconf.ant.xml
/etc/tomcat5/jkconfig.manifest
/etc/tomcat5/logging.properties
/etc/tomcat5/server-minimal.xml
/etc/tomcat5/server.xml
/etc/tomcat5/shm.manifest
/etc/tomcat5/tomcat-jk2.manifest
/etc/tomcat5/tomcat-users.xml
/etc/tomcat5/tomcat5.conf
/etc/tomcat5/uriworkermap.properties
/etc/tomcat5/web.xml
/etc/tomcat5/workers.properties
/etc/tomcat5/workers.properties.minimal
/etc/tomcat5/workers2.properties
/etc/tomcat5/workers2.properties.minimal

[root@P-DBS1 init.d]# rpm -q tomcat5-5.5.23-0jpp.7.el5 -R
/bin/bash
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/bin/sh
config(tomcat5) = 0:5.5.23-0jpp.7.el5
jakarta-commons-daemon >= 1.0.1
jakarta-commons-launcher >= 0:0.9
java-gcj-compat >= 1.0.31
java-gcj-compat >= 1.0.31
jndi-ldap
jpackage-utils >= 0:1.6.0
libc.so.6
libc.so.6(GLIBC_2.1.3)
libdl.so.2
libgcc_s.so.1
libgcc_s.so.1(GCC_3.0)
libgcj_bc.so.1
libm.so.6
libpthread.so.0
librt.so.1
libz.so.1
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
tomcat5-common-lib = 0:5.5.23-0jpp.7.el5
tomcat5-common-lib = 0:5.5.23-0jpp.7.el5
tomcat5-server-lib = 0:5.5.23-0jpp.7.el5
tomcat5-server-lib = 0:5.5.23-0jpp.7.el5
xerces-j2 >= 0:2.7.1
xml-commons-apis >= 1.3
[root@P-DBS1 init.d]# 

 

Kijken of een bepaald programma geinstalleerd is.
En zo ja meer info erover.

[nsisc@E-DBS2 ~]$ rpm -qa |grep PHR   // rpm query all
RTAP.PHRP_09085-A.08.80-1

1)

[nsisc@E-DBS2 ~]$ rpm -qi RTAP.PHRP_09085-A.08.80-1   // rpm query info
Name        : RTAP.PHRP_09085              Relocations: (not relocatable)
Version     : A.08.80                           Vendor: (none)
Release     : 1                             Build Date: Fri 27 Mar 2009 01:43:45 AM CET
Install Date: Mon 04 May 2009 02:21:06 PM CEST      Build Host: iqaluit
Group       : Applications/Databases        Source RPM: RTAP.PHRP_09085-A.08.80-1.src.rpm
Size        : 19934317                         License: Verano
Signature   : (none)
URL         : http://www.verano.com
Summary     : Verano Performux Real-time Database
Description :
Verano Performux cumulative patch.
[nsisc@E-DBS2 ~]$


2)

rpm -qa |grep -i rtap

Query naar alle geinstalleerde RTAP keyword bevattende bestanden.
 


RPM varia   (source : http://www.pixelbeat.org/docs/packaging.html )
-----------------------------------------------------------------------------------------

1.Individual packages are managed by rpm and dpkg on Red Hat and Debian respectively, the common operations being listed below

Red Hat         Description

rpm -Uvh packages(s).rpm    install/upgrade package file(s)
rpm -e package        remove package
rpm -qa '*spell*'        show all packages whose names contain the word spell
rpm -q package        show version of package installed
rpm -q -i package       show all package metadata
rpm -q -i -p package.rpm    show all package file's metadata
rpm -q -f /path/file       what package does file belong
rpm -q -l package       list where files were installed
rpm -q -l -p package.rpm    list where files would be installed
rpm2cpio package.rpm | cpio -id extract package files to current directory
rpm -q --requires package    list files/packages that package needs
rpm -q --whatrequires package  list packages that need package (see also whatrequires)

More complicated commands I find useful are to list all packages by size on RPM and DEB distros respectively:

rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n

 2.At a higher level, package dependencies can be automatically managed by yum and apt. With these tools one can essentially say "install this package" for e.g. and all dependent packages will be installed/upgraded as appropriate. One of course has to configure where these tools can find these packages, and this is typically done by configuring online package repositories.
 
Red Hat         Description

yum update [package list]   upgrade specified packages (or all installed packages if none specified)
yum install <package list>   install latest version of package(s)
yum remove <package list>  remove specified packages from system
yum list [package list]    list available packages from repositories


Uninstall a package :
-> rpm -qa | grep -i <package name>       .. You should then find the exact package name:
<package name>

Then run
rpm -e <package name>to uninstall it.