Package Dependencies Required to Build Samba

From SambaWiki

Operating System-independent Overview

The following is an operating system-independent list of libraries and utilities required to build and install Samba. Depending on your distribution, the name of packages can differ. Usually library packages are named lib*-devel or lib*-dev. For a list of distribution specific package installation commands, see Distribution-specific Packages Required to Build Samba.


Libraries and utilities Required for
python Several utilities, such as samba-tool and the build system (Waf), are written in Python.
acl Required only on Samba Active Directory domain controllers and member servers using Windows ACLs.
xattr Required only on Samba Active Directory domain controllers and member servers using Windows ACLs.
python-crypto Samba AD DC only. Required by samba-tool, for example, to establish trusts.


Libraries and utilities Required for
krb5-devel and krb5-server MIT Kerberos support (Samba 4.7 and later). Requires MIT Kerberos 1.15.1 or later.
gnutls Samba AD DC
jansson-devel Audit logging (Samba 4.7 and later), Samba AD DC
bsd or setproctitle Process title updating support.
xsltproc or docbook Man pages and other documentation.
pam-devel PAM support. For example, to authenticate domain users using PAM.
cups CUPS printer sharing support.
openldap NT4 Domains support, including the Samba NT4 to AD migration (Classic Upgrade).


The following additional packages / utilities are required only for running some tests.

Libraries and utilities Required for
bash Some blackbox tests are bash-specific
python-markdown Reading Microsoft AD schema from github
patch Running some AD DC database tests

Packages Required to Build Samba

Verified Package Dependencies

These links are to and are to our tested package installation scripts. The files are are contained in Samba's official git repository and are subject to Samba's Code Review and testing.

Naturally, you should still check them before running them as root. They may contain more packages than you strictly need, because some items required by Samba's GitLab CI and autobuild tooling are not needed in production.

Distribution Samba master Samba 4.15 Samba 4.14 Samba 4.13 Samba 4.12 Samba 4.11
Debian 9 bootstrap/generated-dists/debian9/ bootstrap/generated-dists/debian9/
Debian 10 bootstrap/generated-dists/debian10/ bootstrap/generated-dists/debian10/ bootstrap/generated-dists/debian10/ bootstrap/generated-dists/debian10/ bootstrap/generated-dists/debian9/
Debian 11 bootstrap/generated-dists/debian10/
Ubuntu 16.04 bootstrap/generated-dists/ubuntu1604/ bootstrap/generated-dists/ubuntu1604/
Ubuntu 18.04 bootstrap/generated-dists/ubuntu1804/ bootstrap/generated-dists/ubuntu1804/ bootstrap/generated-dists/ubuntu1804/ bootstrap/generated-dists/ubuntu1804/ bootstrap/generated-dists/ubuntu1804/ bootstrap/generated-dists/ubuntu1804/
Ubuntu 20.04 bootstrap/generated-dists/ubuntu2004/ bootstrap/generated-dists/ubuntu2004/ bootstrap/generated-dists/ubuntu2004/ bootstrap/generated-dists/ubuntu2004/
OpenSuSE 15.0 bootstrap/generated-dists/opensuse150/ bootstrap/generated-dists/opensuse150/ bootstrap/generated-dists/opensuse150/ bootstrap/generated-dists/opensuse150/ bootstrap/generated-dists/opensuse150/ bootstrap/generated-dists/opensuse150/
OpenSuSE 15.1 bootstrap/generated-dists/opensuse151/ bootstrap/generated-dists/opensuse151/ bootstrap/generated-dists/opensuse151/ bootstrap/generated-dists/opensuse151/ bootstrap/generated-dists/opensuse151/ bootstrap/generated-dists/opensuse151/
Fedora 29 bootstrap/generated-dists/fedora29/ bootstrap/generated-dists/fedora29/
Fedora 30 bootstrap/generated-dists/fedora30/ bootstrap/generated-dists/fedora30/
Fedora 31 bootstrap/generated-dists/fedora31/ bootstrap/generated-dists/fedora31/
Fedora 32 bootstrap/generated-dists/fedora32/ bootstrap/generated-dists/fedora32/
Fedora 33 bootstrap/generated-dists/fedora33/ bootstrap/generated-dists/fedora33/ bootstrap/generated-dists/fedora33/ bootstrap/generated-dists/fedora33/
Fedora 34 bootstrap/generated-dists/fedora34/ bootstrap/generated-dists/fedora34/ bootstrap/generated-dists/fedora34/ bootstrap/generated-dists/fedora34/
CentOS 7 bootstrap/generated-dists/centos7/ bootstrap/generated-dists/centos7/ bootstrap/generated-dists/centos7/ bootstrap/generated-dists/centos7/ bootstrap/generated-dists/centos7/
CentOS 8 bootstrap/generated-dists/centos8/ bootstrap/generated-dists/centos8/ bootstrap/generated-dists/centos8/ bootstrap/generated-dists/centos8/

Manually maintained Distribution-specific Package lists

This list is for older Samba versions (currently all released versions) and distributions not included in the table above

Samba Active Directory Domain Controller

The following installation commands include the BIND DNS server. If you are using the Samba internal DNS server, omit the BIND package(s). However, you require the package containing the nsupdate utility to enable dynamic DNS support.

Debian / Ubuntu

# apt-get install acl attr autoconf bind9utils bison build-essential \
  debhelper dnsutils docbook-xml docbook-xsl flex gdb libjansson-dev krb5-user \
  libacl1-dev libaio-dev libarchive-dev libattr1-dev libblkid-dev libbsd-dev \
  libcap-dev libcups2-dev libgnutls28-dev libgpgme-dev libjson-perl \
  libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl \
  libpopt-dev libreadline-dev nettle-dev perl perl-modules pkg-config \
  python-all-dev python-crypto python-dbg python-dev python-dnspython \
  python3-dnspython python-gpgme python3-gpgme python-markdown python3-markdown \
  python3-dev xsltproc zlib1g-dev liblmdb-dev lmdb-utils


  • Before Debian 8 and Ubuntu 14.04, libgnutls28-dev was known as libgnutls-dev.
  • perl-modules was replace by perl-modules-5.24 on Debian 9
  • perl-modules was replace by perl-modules-5.26 on Ubuntu 17.10
  • python-gpgme and python3-gpgme were replaced by python-gpg and python3-gpg on Debian 9 and Ubuntu 17.10
  • If you are building Samba on a system that uses systemd, you will also require the libsystemd-dev package
  • To use a MIT Kerberos KDC, you will need libkrb5-dev and krb5-kdc, version 1.15.1 or greater.

Red Hat Enterprise Linux 7 / CentOS 7 / Scientific Linux 7

Install the following packages to build Samba as an Active Directory (AD) domain controller (DC) on a minimal Red Hat Enterprise Linux 7, CentOS 7, or Scientific Linux 7 installation:

 # yum install attr bind-utils docbook-style-xsl gcc gdb krb5-workstation \
       libsemanage-python libxslt perl perl-ExtUtils-MakeMaker \
       perl-Parse-Yapp perl-Test-Base pkgconfig policycoreutils-python \
       python2-crypto gnutls-devel libattr-devel keyutils-libs-devel \
       libacl-devel libaio-devel libblkid-devel libxml2-devel openldap-devel \
       pam-devel popt-devel python-devel readline-devel zlib-devel systemd-devel \
       lmdb-devel jansson-devel gpgme-devel pygpgme libarchive-devel

If the DC should act as print server (not recommended) with CUPS back end, additionally install:

# yum install cups-devel


To install the build dependencies for Samba on Fedora, run the following command:

# dnf builddep libldb samba


# zypper source-install --build-deps-only samba


See Building Samba on Gentoo

Samba Domain Member

Red Hat Enterprise Linux / CentOS / Scientific Linux

# yum install autoconf automake gcc gdb krb5-devel krb5-workstation \
   openldap-devel make pam-devel python-devel docbook-style-xsl \
   libacl-devel libattr-devel libxslt 

Samba NT4 PDC

To be added.