Another Japan in the World

Jun Aruga's blog.

Install RPM 4.8.0 on CentOS6

I investigated how default running RPM v4.8.0 [1] is built and installed on CentOS6, because my application [1] needs to support CentOS6. Very old version RPM v4.8.0 is running as a default on CentOS6.

We can use CentOS6 environment, downloading CentOS6 image from DockerHub [3]. This time, I used my extended Docker image based on the CentOS6 image.

Build container's image, and run the built container with interactive mode.

$ git clone
$ sed -i "/^FROM / s|FROM .*|FROM centos:6|" .travis/Dockerfile.centos
$ docker build --rm -t rpm-py-installer -f .travis/Dockerfile.centos .
$ docker run -it rpm-py-installer bash

In container.

# cat /etc/centos-release
CentOS release 6.9 (Final)

# gcc --version | head -1
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)

# yum install wget

# mkdir git

# cd git

# wget

# cd rpm-rpm-4.8.0-release

Below RPM packages are necessary. I also used minimal configure options to check it.

  • libtool nss-devel nspr-devel: Need to pass ./ (autoconf).
  • db4-devel: Berkeley DB
  • zlib-devel: To fix the error " undefined reference to gzdFdopen" on make.
# yum install libtool nss-devel nspr-devel db4-devel zlib-devel

# ./ --noconfigure

# ./configure \
    --prefix=$(pwd)/dest \
    --enable-python \
    --with-external-db \
    --without-lua \
    CPPFLAGS="-I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/db4"

# make

# make install

# dest/bin/rpm --version
RPM version 4.8.0

And other important files for me.

# find ./dest/lib64/python2.6/site-packages/rpm -type f

# cat rpm.pc

Name: RPM
Description: RPM Package Manager
Version: 4.8.0
# Requires: 
# Conflicts:
Cflags: -I${includedir}
Libs: -L${libdir} -lrpm -lrpmio
Libs.private: -lpopt -lrt -lpthread   -ldb  -lz -lnss3 

The Python binding module looks working.

# cd dest/lib64/python2.6/site-packages

# /usr/bin/python --version
Python 2.6.6

# /usr/bin/python -c "import rpm; print(rpm.ts)"
<class 'rpm.transaction.TransactionSet'>