Package Dependencies Required to Build Samba: Difference between revisions

From SambaWiki
m (/* added systemd-devel to RHEL & Fedora required packages)
m (/* updated instructions to install required dependencies)
 
(49 intermediate revisions by 13 users not shown)
Line 16: Line 16:
!Required for
!Required for
|-
|-
|python3
|python
|Several utilities, such as <code>samba-tool</code> and the build system ([[Waf|Waf]]), are written in Python.
|Several utilities, such as <code>samba-tool</code> and the build system ([[Waf|Waf]]), are written in Python 3.x.
|-
|-
|perl
|perl
|
|
|-
|Parse::Yapp
|Used in PIDL, our IDL compiler.
|-
|-
|acl
|acl
Line 28: Line 31:
|Required only on [[Active_Directory_Domain_Controller|Samba Active Directory domain controllers]] and member servers using [[Setting_up_a_Share_Using_Windows_ACLs|Windows ACLs]].
|Required only on [[Active_Directory_Domain_Controller|Samba Active Directory domain controllers]] and member servers using [[Setting_up_a_Share_Using_Windows_ACLs|Windows ACLs]].
|-
|-
|gnutls >= 3.4.7
|python-crypto
|Required for cryptography
|Samba AD DC only. Required by <code>samba-tool</code>, for example, to establish trusts.
|-
|zlib
|Provides the crc32 checksum across Samba and compression for DRSUAPI (AD replication)
|}
|}




== Optional ==
== Optional ==
Line 39: Line 43:
!Libraries and utilities
!Libraries and utilities
!Required for
!Required for
|-
|krb5-devel
|MIT Kerberos support (except a very bare-bones file server and if not using internal Heimdal). Requires MIT Kerberos 1.15.1 or later.
|-
|krb5-server
|MIT Kerberos support (Samba as an AD DC if not using the internal Heimdal). Requires MIT Kerberos 1.15.1 or later.
|-
|-
|blkid
|blkid
|
|
|-
|-
|dbus
|gnutls
|vfs_snapper
|
|-
|-
|jansson-devel
|jansson-devel
|Audit logging (Samba 4.7 and later)
|Audit logging (Samba 4.7 and later), Samba AD DC
|-
|-
|readline
|readline
Line 66: Line 76:
|openldap
|openldap
|[[NT4_Domains|NT4 Domains]] support, including the [[Migrating_a_Samba_NT4_Domain_to_Samba_AD_(Classic_Upgrade)|Samba NT4 to AD migration (Classic Upgrade)]].
|[[NT4_Domains|NT4 Domains]] support, including the [[Migrating_a_Samba_NT4_Domain_to_Samba_AD_(Classic_Upgrade)|Samba NT4 to AD migration (Classic Upgrade)]].
|-
|python3-markdown
|For samba-tool domain schemaupgrade
|-
|patch
|For samba-tool domain schemaupgrade
|-
|gpgme-devel
|For reading passwords in samba-tool user passwordsync from encrypted cleartext
|-
|python3-gpg or python3-gpgme
|For storing passwords for samba-tool user passwordsync in encrypted cleartext
|-
|flex
|Generates C source from the .l lexical analyzer files in our source tree. Used when building the embedded Heimdal or spotlight support
|}
|}


== Selftest ==


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


{| class="wikitable"
!Libraries and utilities
!Required for
|-
|bash
|Some blackbox tests are bash-specific
|-
|python3-iso8601
|Used by our selftest and required from the system in samba 4.14 and later.
|-
|python3-cryptography
|Used by our selftest to test Kerberos
|-
|python3-asn1
|Used by our selftest to test ASN.1 protocols like LDAP and Kerberos
|}


=Packages Required to Build Samba=


If you download a version of Samba >= 4.11.0 (either by <code>git</code> or by using <code>wget</code> to obtain a tarball), you will find in the base of the code a directory named <code>bootstrap</code>. Inside this directory there is another directory named <code>generated-dists</code>. Inside that directory there are further directories named after distros, inside of each of those directories there is a bash script named <code>bootstrap.sh</code>, running this script will install the required dependencies to build the downloaded version of Samba on your distro.
= Distribution-specific Packages Required to Build Samba =


For example, the latest version of Samba is 4.18.5 (This is at the beginning of August 2023), which you can download with:
The following list of commands is neither provided nor actively verified by the Samba team. If you see any missing packages or incorrect package names, please update the command or send the information to the [https://lists.samba.org/mailman/listinfo/samba Samba mailing list].
$ wget https://download.samba.org/pub/samba/stable/samba-4.18.5.tar.gz


After the download, you should find a tarball named <code>samba-4.18.5.tar.gz</code>


You can unpack this tarball with:


$ tar xf samba-4.18.5.tar.gz
== Samba Active Directory Domain Controller ==


After the tarball is unpacked, you should now find that you have a directory named <code>samba-4.18.5</code>.
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 <code>nsupdate</code> utility to enable dynamic DNS support.
You can now <code>cd</code> directly into the directory that holds the distro directories with:


$ cd samba-4.18.5/bootstrap/generated-dists


Checking the contents of the directory with <code>ls</code> should produce output like this:


$ ls
=== Debian / Ubuntu ===
centos7 centos8s debian11 f37mit120 fedora37 opensuse154 ubuntu1804 ubuntu1804-32bit ubuntu2004 ubuntu2204 Vagrantfile


# apt-get install acl attr autoconf bison build-essential \
debhelper dnsutils docbook-xml docbook-xsl flex gdb krb5-user \
libacl1-dev libaio-dev libattr1-dev libblkid-dev libbsd-dev \
libcap-dev libcups2-dev libgnutls-dev libjson-perl \
libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl \
libpopt-dev libreadline-dev perl perl-modules pkg-config \
python-all-dev python-dev python-dnspython python-crypto \
xsltproc zlib1g-dev

Notes:
* libgnutls-dev has been replace by libgnutls28-dev on Debian 8 Jessie and Ubuntu >=14.04
* If you are building Samba on a system that uses systemd, you will also require the libsystemd-dev package
* If you are building Samba >= 4.5.0, you will also require libgpgme11-dev python-gpgme python-m2crypto
* Due to a bug in the Debian <code>xsltproc</code> package ([https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750593 Debian Bug #750593]), Samba fails to build the <code>smb.conf</code> man page and a <code>Segmentation fault</code> error is displayed on 32-bit platforms. To work around the problem:
:* Open the <code>docs-xml/wscript_build</code> file in the Samba source code.
:* Find this line:
' if ('XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']):'
:* Remove or comment out the following line:
SMBDOTCONF_MANPAGE(bld, 'manpages/smb.conf.5')
:* Start compiling the Samba sources. Please note, this will produce a build without a default smb.conf.



=== 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 \
python-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


{{Imbox
{{Imbox
| type = note
| type = note
| text = This list may differ by the version of Samba you are attempting to build.
| text = Red Hat Enterprise Linux 7 does not include all required packages to build a Samba AD DC. Enable the external Extra Packages for Enterprise Linux (EPEL) repository before you install the packages. For details, see https://fedoraproject.org/wiki/EPEL. Enabling the EPEL repository is not requied on CentOS 7 and Scientific Linux 7.
}}
}}


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


If your distro is amongst the listed directories, then <code>cd</code> into the relevant directory and run the <code>bootstrap.sh</code> script you will find there. This will install all the required dependencies.
# yum install cups-devel


If your distro isn't mentioned then you will have to attempt to identify the required dependencies from the information below.




==Manually maintained Distribution-specific Package lists==
=== Fedora ===
'''This list is for older Samba versions (4.10 and earlier) and distributions not included in the table above'''


{{Imbox
==== Fedora 25 ====
| type = warning
| text = The following list of commands is neither provided nor actively verified by the Samba team. Additionally, it might be possible that you require additional or less packages than shown in the later commands - depending on the purpose you install Samba. Do not depend on the lists below, they are just a guide, use the <code>bootstrap.sh</code> scripts supplied above.
}}


Install the following packages to build Samba as an Active Directory (AD) domain controller (DC) on Fedora 25:


# dnf 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 \
python-crypto gnutls-devel libattr-devel keyutils-libs-devel \
libacl-devel libaio-devel libblkid-devel libxml2-devel openldap-devel \
pam-devel popt-devel python2-devel readline-devel zlib-devel jansson-devel \
gpgme-devel systemd-devel


=== Samba Active Directory Domain Controller ===
=== openSUSE ===


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 <code>nsupdate</code> utility to enable dynamic DNS support.
# zypper install libacl-devel python-selinux autoconf make \
python-devel gdb sqlite3-devel libgnutls-devel binutils \
policycoreutils-python setools-libs selinux-policy \
setools-libs popt-devel libpcap-devel keyutils-devel \
libidn-devel libxml2-devel libacl-devel libsepol-devel \
libattr-devel zlib-devel cyrus-sasl-devel gcc \
krb5-client openldap2-devel libopenssl-devel\
bind-utils bind-lib






=== Gentoo ===
==== Debian / Ubuntu ====


# apt-get install acl attr autoconf bind9utils bison build-essential \
Please note that the following sections assume at least an intermediate understanding of the Gentoo packaging system.
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


Notes:
* Before Debian 8 and Ubuntu 14.04, <code>libgnutls28-dev</code> was known as <code>libgnutls-dev</code>.
* 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 [[Running a Samba AD DC with MIT Kerberos KDC | MIT Kerberos KDC]], you will need <code>libkrb5-dev</code> and <code>krb5-kdc</code>, version 1.15.1 or greater.




==== Python ====
==== Red Hat Enterprise Linux 8 / CentOS 8 ====


Install the following packages to build Samba as an Active Directory (AD) domain controller (DC) on a minimal Red Hat Enterprise Linux (RHEL) 8 or CentOS 8 installation:
Gentoo uses Python 3 as the default python interpreter, but at this time Samba requires Python 2 (2.4.2 or later). The following set of commands will install and set up Python 2 as the default python interpreter.


# yum install docbook-style-xsl gcc gdb gnutls-devel gpgme-devel jansson-devel \
# emerge --ask --noreplace '<dev-lang/python-3'
keyutils-libs-devel krb5-workstation libacl-devel libaio-devel \
# eselect python set python2.7
libarchive-devel libattr-devel libblkid-devel libtasn1 libtasn1-tools \
# python-updater
libxml2-devel libxslt lmdb-devel openldap-devel pam-devel perl \
perl-ExtUtils-MakeMaker perl-Parse-Yapp popt-devel python3-cryptography \
python3-dns python3-gpg python36-devel readline-devel rpcgen systemd-devel \
tar zlib-devel


To install all required packages, you must enable the following repositories:
{| class="wikitable"
!RHEL 8
!CentOS 8
|-
|<code>Base</code>
|<code>Base</code>
|-
|<code>AppStream</code>
|<code>AppStream</code>
|-
|<code>CodeReady Linux Builder</code>*
|<code>PowerTools</code>
|-
|<code>EPEL</code>**
|<code>EPEL</code>**
|}
<nowiki>*</nowiki> For further details about the CodeReady Linux Builder repository, see https://access.redhat.com/articles/4348511.


<nowiki>**</nowiki> The Extra Packages for Enterprise Linux (EPEL) repository is not part of the distribution. For further details about EPEL, see https://fedoraproject.org/wiki/EPEL.


For enabling PowerTools repository on CentOS 8, please use following commands:
==== Kerberos ====


# yum -y install dnf-plugins-core
On Gentoo, you have two choices for a kerberos implementation, app-crypt/mit-krb5 and app-crypt/heimdal. Unfortunately the two implementations can not be installed at the same time. Currently, the Samba only supports app-crypt/heimdal. So you must first uninstall app-crypt/mit-krb5, if installed. Then install app-crypt/heimdal and rebuild any packages that were using the previous kerberos implementation.
# yum config-manager --set-enabled PowerTools


If the DC should act as a print server with CUPS back end, additionally install the following package
# emerge --unmerge --ask app-crypt/mit-krb5
# emerge --ask app-crypt/heimdal
# revdep-rebuild -- -ask


# yum install cups-devel


==== 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:
==== BIND ====


# yum install attr bind-utils docbook-style-xsl gcc gdb krb5-workstation \
To enable automatic zone management, net-dns/bind and net-dns/bind-tools should be emerged with the USE flags for berkdb, dlz and gssapi set. To enable them permanently, add the following to /etc/package.use:
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


net-dns/bind berkdb dlz gssapi
net-dns/bind-tools gssapi


{{Imbox
Then, emerge net-dns/bind:
| type = note
| text = Red Hat Enterprise Linux 7 does not include all required packages to build a Samba AD DC. Enable the external Extra Packages for Enterprise Linux (EPEL) repository before you install the packages. For details, see https://fedoraproject.org/wiki/EPEL. Enabling the EPEL repository is not requied on CentOS 7 and Scientific Linux 7.
}}


{{Imbox
# emerge --ask net-dns/bind net-dns/bind-tools
| type = note
| text = Red Hat Enterprise Linux 7 and deritivites do not provide a GnuTLS version >= 3.4.7, even when EPEL is used. Users building Samba 4.12 will need to obtain GnuTLS from outside RHEL7 / CentOS7 / EPEL to use Samba 4.12.
}}




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


# yum install cups-devel
==== Samba-supplied Libraries (tdb/ldb/tevent) ====


==== Fedora ====
There are a few Samba libraries that need to be installed. Note that these packages might be keyworded as unstable, so you might need to add the following to your /etc/package.keywords:


To install the build dependencies for Samba on Fedora, run the following command:
~sys-libs/tevent-0.9.17
~sys-libs/tdb-1.2.10
~sys-libs/ldb-1.1.12
~sys-libs/talloc-2.0.7


# dnf builddep libldb samba
Additionally, Samba requires sys-libs/tdb and sys-libs/talloc to be emerged with the USE flag python set. To enable this permanently, add the following to /etc/package.use:


==== openSUSE ====
sys-libs/tdb python
sys-libs/talloc python


# zypper source-install --build-deps-only libldb1 samba
Note: In new(er) installations of Gentoo, the above files will be located in /etc/portage/, i.e. /etc/portage/package.keywords and /etc/portage/package.use. They may be symlinked to /etc for backward compatibility.


==== Gentoo ====
Now, emerge the packages:


See [[Package_Dependencies_Required_to_Build_Samba/Building Samba on Gentoo|Building Samba on Gentoo]]
# emerge --ask '=sys-libs/talloc-2.0.7' '=sys-libs/tdb-1.2.10' '=sys-libs/tevent-0.9.17' '=sys-libs/ldb-1.1.12'


=== Samba Domain Member ===
Note that ebuilds for the required versions of the above packages might not be availiable in the portage tree. In this case, check [https://bugs.gentoo.org/ Gentoo's Bugzilla] for updated ebuilds.


==== Red Hat Enterprise Linux 8 / CentOS 8 ====


Install the following packages to build Samba as a domain member on a minimal Red Hat Enterprise Linux (RHEL) 8 or CentOS 8 installation:


# yum install autoconf automake docbook-style-xsl gcc gdb jansson-devel \
==== Other Misc. Build/Run Dependencies ====
krb5-devel krb5-workstation libacl-devel libarchive-devel \
libattr-devel libtasn1-tools libxslt lmdb-devel make openldap-devel \
pam-devel python36-devel rpcgen


To install all required packages, you must enable the following repositories:
To ensure a successful Samba 4 installation, there are a few other packages that should be installed, as shown below:
{| class="wikitable"
!RHEL 8
!CentOS 8
|-
|<code>Base</code>
|<code>Base</code>
|-
|<code>AppStream</code>
|<code>AppStream</code>
|-
|<code>CodeReady Linux Builder</code>*
|<code>PowerTools</code>
|-
|<code>EPEL</code>**
|<code>EPEL</code>**
|}
<nowiki>*</nowiki> For further details about the CodeReady Linux Builder repository, see https://access.redhat.com/articles/4348511.


<nowiki>**</nowiki> The Extra Packages for Enterprise Linux (EPEL) repository is not part of the distribution. For further details about EPEL, see https://fedoraproject.org/wiki/EPEL.
# emerge --ask net-libs/gnutls sys-apps/acl dev-libs/cyrus-sasl dev-python/subunit dev-python/dnspython net-dns/libidn


For enabling PowerTools repository on CentOS 8, please use following commands:
FIXME: Are dev-python/dnspython net-dns/libidn still required?


# yum -y install dnf-plugins-core
# yum config-manager --set-enabled PowerTools


If the domain member should act as a print server with CUPS back end, additionally install the following package:


# yum install cups-devel


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

== Samba Domain Member ==

=== Red Hat Enterprise Linux / CentOS / Scientific Linux ===


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






== Samba NT4 PDC ==
=== Samba NT4 PDC ===


To be added.
To be added.

Latest revision as of 08:30, 4 August 2023

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.


Mandatory

Libraries and utilities Required for
python3 Several utilities, such as samba-tool and the build system (Waf), are written in Python 3.x.
perl
Parse::Yapp Used in PIDL, our IDL compiler.
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.
gnutls >= 3.4.7 Required for cryptography
zlib Provides the crc32 checksum across Samba and compression for DRSUAPI (AD replication)

Optional

Libraries and utilities Required for
krb5-devel MIT Kerberos support (except a very bare-bones file server and if not using internal Heimdal). Requires MIT Kerberos 1.15.1 or later.
krb5-server MIT Kerberos support (Samba as an AD DC if not using the internal Heimdal). Requires MIT Kerberos 1.15.1 or later.
blkid
dbus vfs_snapper
jansson-devel Audit logging (Samba 4.7 and later), Samba AD DC
readline
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).
python3-markdown For samba-tool domain schemaupgrade
patch For samba-tool domain schemaupgrade
gpgme-devel For reading passwords in samba-tool user passwordsync from encrypted cleartext
python3-gpg or python3-gpgme For storing passwords for samba-tool user passwordsync in encrypted cleartext
flex Generates C source from the .l lexical analyzer files in our source tree. Used when building the embedded Heimdal or spotlight support

Selftest

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

Libraries and utilities Required for
bash Some blackbox tests are bash-specific
python3-iso8601 Used by our selftest and required from the system in samba 4.14 and later.
python3-cryptography Used by our selftest to test Kerberos
python3-asn1 Used by our selftest to test ASN.1 protocols like LDAP and Kerberos

Packages Required to Build Samba

If you download a version of Samba >= 4.11.0 (either by git or by using wget to obtain a tarball), you will find in the base of the code a directory named bootstrap. Inside this directory there is another directory named generated-dists. Inside that directory there are further directories named after distros, inside of each of those directories there is a bash script named bootstrap.sh, running this script will install the required dependencies to build the downloaded version of Samba on your distro.

For example, the latest version of Samba is 4.18.5 (This is at the beginning of August 2023), which you can download with:

$ wget https://download.samba.org/pub/samba/stable/samba-4.18.5.tar.gz

After the download, you should find a tarball named samba-4.18.5.tar.gz

You can unpack this tarball with:

$ tar xf samba-4.18.5.tar.gz

After the tarball is unpacked, you should now find that you have a directory named samba-4.18.5. You can now cd directly into the directory that holds the distro directories with:

$ cd samba-4.18.5/bootstrap/generated-dists

Checking the contents of the directory with ls should produce output like this:

$ ls
centos7  centos8s  debian11  f37mit120  fedora37  opensuse154  ubuntu1804  ubuntu1804-32bit  ubuntu2004  ubuntu2204  Vagrantfile



If your distro is amongst the listed directories, then cd into the relevant directory and run the bootstrap.sh script you will find there. This will install all the required dependencies.

If your distro isn't mentioned then you will have to attempt to identify the required dependencies from the information below.


Manually maintained Distribution-specific Package lists

This list is for older Samba versions (4.10 and earlier) 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

Notes:

  • 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 8 / CentOS 8

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

# yum install docbook-style-xsl gcc gdb gnutls-devel gpgme-devel jansson-devel \
      keyutils-libs-devel krb5-workstation libacl-devel libaio-devel \
      libarchive-devel libattr-devel libblkid-devel libtasn1 libtasn1-tools \
      libxml2-devel libxslt lmdb-devel openldap-devel pam-devel perl \
      perl-ExtUtils-MakeMaker perl-Parse-Yapp popt-devel python3-cryptography \
      python3-dns python3-gpg python36-devel readline-devel rpcgen systemd-devel \
      tar zlib-devel

To install all required packages, you must enable the following repositories:

RHEL 8 CentOS 8
Base Base
AppStream AppStream
CodeReady Linux Builder* PowerTools
EPEL** EPEL**

* For further details about the CodeReady Linux Builder repository, see https://access.redhat.com/articles/4348511.

** The Extra Packages for Enterprise Linux (EPEL) repository is not part of the distribution. For further details about EPEL, see https://fedoraproject.org/wiki/EPEL.

For enabling PowerTools repository on CentOS 8, please use following commands:

# yum -y install dnf-plugins-core
# yum config-manager --set-enabled PowerTools

If the DC should act as a print server with CUPS back end, additionally install the following package

# yum install cups-devel

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

Fedora

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

# dnf builddep libldb samba

openSUSE

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

Gentoo

See Building Samba on Gentoo

Samba Domain Member

Red Hat Enterprise Linux 8 / CentOS 8

Install the following packages to build Samba as a domain member on a minimal Red Hat Enterprise Linux (RHEL) 8 or CentOS 8 installation:

# yum install autoconf automake docbook-style-xsl gcc gdb jansson-devel \
      krb5-devel krb5-workstation libacl-devel libarchive-devel \ 
      libattr-devel libtasn1-tools libxslt lmdb-devel make openldap-devel \
      pam-devel python36-devel rpcgen

To install all required packages, you must enable the following repositories:

RHEL 8 CentOS 8
Base Base
AppStream AppStream
CodeReady Linux Builder* PowerTools
EPEL** EPEL**

* For further details about the CodeReady Linux Builder repository, see https://access.redhat.com/articles/4348511.

** The Extra Packages for Enterprise Linux (EPEL) repository is not part of the distribution. For further details about EPEL, see https://fedoraproject.org/wiki/EPEL.

For enabling PowerTools repository on CentOS 8, please use following commands:

# yum -y install dnf-plugins-core
# yum config-manager --set-enabled PowerTools

If the domain member should act as a print server with CUPS back end, additionally install the following package:

# yum install cups-devel

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

# 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.