I would like to know if is there any utility like Debian's pbuilder, to build RPM packages on RedHat using a clean environment (chroot).

I've found mach which has support for something like this but under a Debian environment, and doesn't support RHEL. I need something that runs on RHEL 5.5.

4 Answers 4


Mock is what you're looking for. It's based on Mach and is packaged in EPEL. I regularly use it to build RPM packages for and on RHEL and Fedora.


The OpenSUSE Build System support multiple distributions and supports the environment that you describe, a sandboxed environment to ensure that the builds are consistent and reliable:


You can also install the OpenSUSE Build System as an appliance. This is a self-contained Linux VM image (VMware, QEmu, or ISO versions are supported) that contain the entire stack to set up your own build farms:



mach supports RHEL with an appropriate configuration file, ex:

V  = '5Server' # distro version
VS = '5'       # 'short' version
A  = 'i386'    # architecture
AS = ''        # 'short' version of arch
DIST = 'rhel-%s-%s' % (V, A)

### RHEL flavours

yumsources[DIST] = {
  'os':               rhelyum + '/%s/%s/os'                         % (V, A),
  'updates':          rhelyum + '/%s/%s/updates'                    % (V, A),

packages['%s' % DIST] = {
  'dir':      DIST,
  'minimal':  'bash glibc redhat-release',
  'base':     'coreutils findutils openssh-server',
  'build':    'dev redhat-rpm-config rpm-build make gcc gcc-c++ tar gzip ' +
              'patch unzip bzip2 diffutils cpio elfutils which',
sourceslist['%s' % DIST] = {
  DIST: ('os', 'updates', )
config['%s' % DIST] = {
  'runuser': '/sbin/runuser',
  'macros':  { 'dist': '.el' + VS, 'rhel': VS, 'redhat': VS},
aliases['%s' % DIST] = ('el' + VS + AS, )

If you want to go the whole way, you can set up Koji, which uses Mock (from cdgagne's answer) as one of it's components. Koji is what builds Fedora and is freely downloadable from its website. Afaik, Fedora runs Koji on RHEL, so it should be fine for your purposes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .