Rpm Tools


Table of Contents

cmd:rpm 
Routine usage 
info query 
Sample usage 
From rpm file name to rpm package name 
Remove devel packages 
Help 
into db 
.rpm files 
.rpm files 
rpm for solaris 
Recompile a source rpm your own way 
Howto 
History 
Trying history 
Help 
Install From Source RPMs 
frustrated with rpm 
frustrated with rpm 
frustrated with rpm 
rpm option to install regardless of "conflicts" is….' 
rpm option to install regardless of "conflicts" is….' 
cmd:kpackage 
rpmfind 
Info 
Source 
Comments 
Help 
Version 1.6-1-rpm 
Version 1.6-6-rpm 
How do I determine what to install? 
rpm failed dependencies 
RPM Problems (major numbers <= 3) 
cmd:Alien 

cmd:rpm 

Routine usage 

info gen 

rpmc -qilp postgresql-* > ~/discards/postgresql-all.lst

info query 

rpmf pgaccess ~/discards/postgresql-all.lst
cat ~/discards/postgresql-all.lst | rpmf pgaccess
rpmc -qail | rpmf sshd.conf
rpm -qp --requires <file.rpm>

If you're unsure if the packages you're adding manually are going to work, you can use it to see if you can resolve them.

rpm -qa --queryformat='%{NAME}\n'

info query 

rpmp=ksconfig

one package 

$ rpmc -qi $rpmp | sed -n '1p; /^Summary/p'
Name        : ksconfig                     Relocations: (not relocateable)
Summary     : A graphical interface for making kickstart files.
$ rpmc -qi $rpmp | sed -n '1p; /^Summary/,$p'
Name        : ksconfig                     Relocations: (not relocateable)
Summary     : A graphical interface for making kickstart files.
Description :
This package contains a graphical tool for creating kickstart files.
The ksconfig utility will allow you to set most of the kickstart
options.

File listing 

# file listing
rpm -ql $rpmp | xargs ls -l
# directory listing
rpm -ql miniChinput | xargsl1 dirname | sort -u | xargs ls -ld

Summary for all packages 

rpmc -qai | grep -E "^(Name|Summary)$s*:"
rpmc -qip x* | grep -E "^(Name|Summary)$s*:" | cut -c15- | sed 's/ *Relocations: .*//'

Sample usage 

package info 

rpm -qaiRl > ~/discards/rpms.lst
rpm -qpiRl pkg

show the info of a un-installed rpm package. 

rpm -qpi mkkickstart-2.1-1.noarch.rpm

list what it depends on 

rpm -qpR xxxx.rpm

You can swap '-R' with '—requires'

list what files it includes 

rpm -qpl xxxx.rpm
rpm -q -p -i --list xxxx.rpm

Verify 

rpm -V -p <package>

Installation 

rpm -qpR <package>
rpm -i -vv !$ | tee /tmp/rmp.inst.!$.log
rpm -i --nodeps

— Don't do a dependency check before installing or upgrading!

Upgrade 

rpm -U -vv <package> [-f]

Query 

rpm -q tcl
rpm -qa

Which package it comes from? 

rpm -qail | cgreps "^Group$s" printcap
rpm -qp -filesbypkg /mnt/cdrom/RedHat/RPMS/*.rpm | grep libwraster.so.1

which results in:

WindowMaker               /usr/X11R6/lib/libwraster.so.1
WindowMaker               /usr/X11R6/lib/libwraster.so.1.2.0

Remove 

rpm -evv emacs-X11-20.5-7
rpm -qa --queryformat='%{NAME}\n' | grep mozilla | xargs rpm -e

From rpm file name to rpm package name 

ls *.rpm | sed 's/-[0-9][0-9.]*.*$//'

Remove devel packages 

rpmc -qa | grep -- '-devel' | sort > /tmp/rpm-devel.lst.0
rpmc -qa | grep -- '-devel' | xargs -l1 rpm -ev

— repeat several times.

[Tip]

!!

The only two packages that are absolutely necessary are:

glibc-devel is needed by gcc-2.96-98
libstdc++-devel = 2.96 is needed by gcc-c++-2.96-98

Help 

QUERY OPTIONS The general form of an rpm query command is

rpm -q [query-options]
-p <package_file>
-i     Display  package  information,  including  name,  version, and
       description.
-R, --requires
       List packages on which this package depends.
-l, --list
       List files in package.
--triggerscripts
       Shows all the trigger scripts for the selected packages.

into db 

rpmc -qip x* | grep -E "^(Name|Summary)$s*:" | cut -c15- | sed 's/ *Relocations: .*//'

documented on: 2000.10.23 Mon 21:58:55