Home|Cudeso|Linux|*NIX / BSD|Misc|
 

rpm-manager

Contents

1. Introduction

2. Package construction

3. Package installation

4. Upgrade a package

5. Delete a package

6. Query a package

7. Rebuild your database

8. Create your own rpm from a source-rpm





1. Introduction

The Red Hat Package Manager is a useful system-administration that provides an easy interface for upgrading and installing new software, libraries and tools. RPM-packages aren't exclusive for RedHat but for example Mandrake uses a similar (and compatibel) system.

2. Package construction

A rpm-package is a compressed 'container' of one or more files. It has a label, versionnumber and package-releasenumber. Through the package description you can retrieve useful information like where it was build, by whom and which vendor constructed the package.

3. Package installation

A package can either be installed from a local disc (hard-disk, cd-rom) or from a network-resource.
rpm -ivh /home/download/apache-devel-1.3.20-16
rpm -ivh ftp://ftp.redhat.com/../i386/RPMS/apache-devel-1.3.20-16
Some useful settings when installing a package :
rpm -i
  -h  print out a '#' indicating the progress
  -v  be verbose
  --test perform a test
  --nodeps don't check the dependencies
  --force perform forced installation
  --noscripts do not execute post-installation scripts

4. Upgrade a package

When you're upgrading a package it will never replace a configuration file that has been changed. Upgrading (rpm -U) installs a new package whereas freshening (rpm -F) only upgrades packages that are already installed.

5. Delete a package

Deleting is as easy as installing (allthough dependencies can be a pain).
rpm -e
  --test perform a test
  --force perform forced installation
  --noscripts do not execute post-installation scripts
One remark : configuration files will never be removed when you un-install a package.

6. Query a package

Before you try to install, upgrade or delete a package it could be a very wise idea to first learn something more about the package and get to know what exactly it is doing.
rpm -q
  -f   look for packages containing files with 'file-name'
  -a  look in all installed packages
  -i  display summary info
  -l  display all the files that are contained in the package
  -c  display all the configuration files in the package

7. Rebuild your database

Allthough this should be handled by a cron-job, you can rebuild the rpm-database. This can come in handy when you're experiencing troubles when installing or removing packages.
rpm --rebuilddb

8. Create your own rpm from a source-rpm

Sometimes you will not find a suitable rpm file (maybe because you're running an older distro). In that case, you can still make use of the rpm-manager as long as you can get your hands on the source-rpm.

First of all, you will need to install the source-rpm itself (just by rpm -ivh mysourcerpm.rpm).

Now when you navigate to the directory /usr/src/redhat you will see that there's a directory SOURCES and a directory SPECS. The SOURCE directory (how obvious) contains the .tar.gz-file. The SPECS directory contains a file that outlines which settings need to be used during the creation of the rpm-file (much like a 'regular' configure script). When you edit this file with your favorite editor, you can manually change the way the file is going to be compiled.

When you're done editing the specs-file, save it and enter
rpm -ba myspecsfile.specs
After you hit enter you will see a similar process as the one the you get when you're compiling a package. When the 'compiling' stops, you can install the rpm-file in the usual way.
Copyleft 2002-2007 - cudeso.bewebmaster@cudeso.betop