RPM Notes

Antonello Piemonte
email (remove the pig noise): apiemont at SNORT googlemail dot com


Allowing users to build rpm's packages

By default, to build RPM packages one needs to be root under the /usr/src/redhat directory. To avoid that, give the following command under root:

chown -R username /usr/src/redhat

However, you can build RPM packages in any directory owned by username by putting the following line in ~/.rpmmacros:

%_topdir /home/username/rpm

You must then create additional subdirectories as follows:

cd /home/username/rpm
mkdir SOURCES SPECS BUILD SRPMS
mkdir -p RPMS/i386 RPMS/athlon RPMS/i486 RPMS/i586 RPMS/i686 RPMS/noarch

Building from an SRPM

A prerequisite is that the package rpm-build must be installed on the system. Having said that, install the .src.rpm file

rpm -i somepackage-1.0-1.src.rpm

This will create files in /usr/src/redhat/SOURCES and a .spec file in /usr/src/redhat/SPECS.

Then go the SPECS directory and give the command to build the RPM:

cd /usr/src/redhat/SPECS
rpmbuild -bb somepackage.spec
the rpm package will be in /usr/src/redhat/RPMS/i386/

Updating rpm V3 to rpm V4 on RedHat 6.2

install first db3:

#rpm -ivh  db3-3.1.17-4.6x.i386.rpm  
#rpm -ivh db3-utils-3.1.17-4.6x.i386.rpm
then upgrade popt (use -F since older version was already installed)
#rpm -Fvh popt-1.6.2-6x.i386.rpm
then backup var/lib/rpm* and /usr/lib/rpm* and clean up a bit ...
# rpm -e rpm-build  
# rpm -e  rpm-devel 
# rpm -e up2date  
# rpm -e rpm-python   
# rpm -e rpmdb-redhat   
then install rpm and soon after rebuild the database!!
# rpm -Fvh  rpm-4.0.2-6x.i386.rpm 
# rpm --rebuilddb 
that's it, enjoy!

Further Reading

TODO

Add info on importing GPG keys and APT4RPM
This page last modified
July 25, 2003
Valid HTML 4.01! Made with Bluefish!