Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|improve this answer

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:


share|improve this answer

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, )
share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.