Skip to content

Convenience Binaries

Dianjin Wang edited this page Mar 4, 2026 · 5 revisions

This page describes how to build RPM and DEB convenience binaries for:

  • Apache Cloudberry (Main Repository)
  • cloudberry-backup
  • cloudberry-pxf

The overall workflow follows two major steps:

  1. Build installation artifacts
  2. Package them into RPM or DEB

For a faster and reproducible build environment (supported from Cloudberry 2.1+), please refer to: https://cloudberry.apache.org/docs/deployment/build-based-on-docker.

1. Apache Cloudberry (Main Repository)

1.1 Build Installation Artifacts

Before packaging, you must build Cloudberry from source.

You may either:

  • Build manually from source, or
  • Use the official Docker-based build script (recommended for 2.1+)

The build output should produce a complete installation directory, typically:

/usr/local/cloudberry-db-<version>/

Build RPM Package

Step 1: Install rpmbuild

sudo dnf install rpm-build

Step 2: Prepare rpmbuild directories and spec file

mkdir -p ~/rpmbuild/SPECS
cp ~/cloudberry/devops/build/packaging/rpm/apache-cloudberry-db-incubating.spec \
  ~/rpmbuild/SPECS/

Copy the LICENSE file into the installation directory:

sudo cp /path/to/cloudberry/LICENSE \
  /usr/local/cloudberry-db-2.1.0/

Step 3: Run RPM build script

cd devops/build/packaging/rpm
./build-rpm.sh -v <version> -r <release>

Example:

./build-rpm.sh -v 2.1.0 -r 1

Output Location:

ls ~/rpmbuild/RPMS/aarch64/apache-cloudberry-db-incubating-2.1.0-1.el9.aarch64.rpm

Build DEB Package (Ubuntu 22.04)

Step 1: Install Required Tools

sudo apt install dpkg-dev

Step 2: Prepare Debian Packaging Files

cd ~/cloudberry
mkdir -p debian
cp -r devops/build/packaging/deb/ubuntu22.04/* ./debian/

Step 3: Build DEB

./devops/build/packaging/deb/build-deb.sh -v 2.1.0

The resulting .deb package will be generated in the parent directory of the cloudberry source directory (i.e., one level above the current cloudberry directory where the build command is executed), not inside the cloudberry directory itself.

Install and Verify RPM/DEB

# For RPM
sudo dnf install -y apache-cloudberry-db-incubating-2.1.0-1.el9.aarch64.rpm

# For DEB
sudo apt update
sudo apt --fix-broken install -y ./apache-cloudberry-db-incubating-2.1.0-1-ubuntu22.04-adm64.deb

After installation:

  • A gpadmin user should be configured
  • Default installation path: /usr/local/cloudberry-db

Start Single-Node Demo Cluster

Switch to gpadmin:

su - gpadmin
source /usr/local/cloudberry-db/cloudberry-env.sh

Create a clean demo directory:

mkdir -p ~/cloudberry-demo
cd ~/cloudberry-demo

Initialize demo cluster:

gpdemo
source ./gpdemo-env.sh

Verify connection:

psql postgres

Clone this wiki locally