docs/content/stable/contribute/core-database/build-from-src-almalinux.md
{{< note title="Note" >}}
AlmaLinux 8 is the recommended Linux development platform for YugabyteDB.
{{< /note >}}
{{% readfile "includes/tldr.md" %}}
# Modify to your preference:
shellrc=~/.bashrc
sudo dnf update -y
sudo dnf groupinstall -y 'Development Tools'
sudo dnf -y install epel-release
packages=(
ccache
gcc-toolset-11
gcc-toolset-11-libatomic-devel
golang
java-1.8.0-openjdk
libatomic
maven
npm
patchelf
python3.11
rsync
)
sudo dnf -y install "${packages[@]}"
sudo alternatives --set python3 /usr/bin/python3.9
latest_zip_url=$(curl -Ls "https://api.github.com/repos/ninja-build/ninja/releases/latest" \
| grep browser_download_url | grep ninja-linux.zip | cut -d \" -f 4)
curl -Ls "$latest_zip_url" | zcat | sudo tee /usr/local/bin/ninja >/dev/null
sudo chmod +x /usr/local/bin/ninja
sudo mkdir /opt/yb-build
# If you'd like to use an unprivileged user for development, manually
# run/modify instructions from here onwards (change $USER, make sure shell
# variables are set appropriately when switching users).
sudo chown "$USER" /opt/yb-build
mkdir ~/tools
curl -L "https://github.com/Kitware/CMake/releases/download/v3.31.0/cmake-3.31.0-linux-x86_64.tar.gz" | tar xzC ~/tools
source <(echo 'export PATH="$HOME/tools/cmake-3.31.0-linux-x86_64/bin:$PATH"' \
| tee -a "$shellrc")
source <(echo 'export YB_CCACHE_DIR="$HOME/.cache/yb_ccache"' \
| tee -a "$shellrc")
git clone https://github.com/yugabyte/yugabyte-db
cd yugabyte-db
./yb_release
Update and install basic development packages as follows:
sudo dnf update -y
sudo dnf groupinstall -y 'Development Tools'
sudo dnf -y install epel-release libatomic rsync
{{% readfile "includes/opt-yb-build.md" %}}
{{% readfile "includes/python.md" %}}
The following example installs Python 3.11.
sudo dnf install -y python3.11
Set this as the default python3, if desired. It is only necessary that python3.11 be in the PATH, it need not be the default python.
sudo alternatives --set python3 /usr/bin/python3.11
sudo alternatives --display python3
python3 -V
{{% readfile "includes/cmake.md" %}}
{{% readfile "includes/java.md" %}}
Install the following packages to satisfy the preceding requirements:
sudo dnf install -y java-1.8.0-openjdk maven
{{% readfile "includes/yugabyted-ui.md" %}}
sudo dnf install -y npm golang
{{% readfile "includes/ninja.md" %}}
The latest release can be downloaded:
latest_zip_url=$(curl -Ls "https://api.github.com/repos/ninja-build/ninja/releases/latest" \
| grep browser_download_url | grep ninja-linux.zip | cut -d \" -f 4)
curl -Ls "$latest_zip_url" | zcat | sudo tee /usr/local/bin/ninja >/dev/null
sudo chmod +x /usr/local/bin/ninja
{{% readfile "includes/ccache.md" %}}
sudo dnf install -y ccache
# Also add the following line to your .bashrc or equivalent.
export YB_CCACHE_DIR="$HOME/.cache/yb_ccache"
To compile with GCC, install the following packages, and adjust the version numbers to match the GCC version you plan to use.
sudo dnf install -y gcc-toolset-11 gcc-toolset-11-libatomic-devel
{{% readfile "includes/build-the-code.md" %}}
Perform the following steps to build a release package:
Install patchelf:
sudo dnf install -y patchelf
Run the yb_release script using the following command:
./yb_release
......
2023-02-14 04:14:16,092 [yb_release.py:299 INFO] Generated a package at '/home/user/code/yugabyte-db/build/yugabyte-2.17.2.0-b8e42eecde0e45a743d51e244dbd9662a6130cd6-release-clang15-centos-x86_64.tar.gz'
{{% readfile "includes/ulimit.md" %}}