Skip to content

Installing Netatalk on Fedora Linux

Daniel Markstedt edited this page Nov 7, 2024 · 4 revisions

Install the latest Netatalk

The easiest way to get Netatalk on Fedora is to install the netatalk RPM package with dnf.

For building and installing from source yourself, find the official documentation below.

AppleTalk

If you want to use Netatalk as an AppleTalk server, you may need to insetall the kernel-modules-extra subpackage if not already present on your system.

Then you need to remove Fedora's default blacklist of the appletalk kernel module. This can be achieved by editing the following file and commenting out the line that says "blacklist appletalk".

/etc/modprobe.d/appletalk-blacklist.conf

This will allow Fedora to load the appletalk kernel module.

Note: Do not delete this file. The system will simply recreate it at a later point.

Netatalk v3

This installation guide was originally written for Netatalk 3.2.0 on Fedora 39.

It describes the steps for using the Autotools build system, which was removed in Netatalk 4.0.0. For building Netatalk v4, please see the links above.

Required Packages

Install the following packages by dnf.

  • gcc
  • libtool
  • make
  • automake
  • libevent-devel (used by netatalk(8))
  • libdb-devel (dbd CNID backend)
  • libgcrypt-devel (DHX2 auth)
  • openssl-devel or libressl-devel (DHX auth aka DHCAST128)
  • krb5-devel (Kerberos V auth)
  • pam-devel (PAM)
  • avahi-devel (Bonjour support)
  • cracklib-devel (password check)
  • libacl-devel (ACL support)
  • openldap-devel (enhanced ACL support)
  • dbus-devel (used by afpstats command)
  • dbus-glib-devel (used by afpstats command)
  • glib2-devel (used by afpstats command)
  • perl-IO-Socket-INET6 (used by asip-status command)
  • perl-IO-Socket-IP (used by asip-status command)
  • systemtap-sdt-devel (DTrace-compatible)
  • tracker (used for spotlight indexing)
  • tracker-devel (used for spotlight indexing)
  • libtalloc-devel (spotlight dependency)
  • bison (spotlight dependency)
  • flex (spotlight dependency)
  • quota-devel (quota support)

Build

Get the tarball from Netatalk Web Site and extract it, or clone the git repo from GitHub.

If cloned from git repo, run bootstrap to generate the build files.

$ ./bootstrap

You should read the configure help message, in order to know configure options.

If the applicable libraries are installed, many options will be detected automatically.

$ ./configure --help

Do configure! The following options are not auto-detected.

$ ./configure \
   --with-init-style=redhat-systemd \
   --with-cracklib \
   --enable-krbV-uam \
   --with-pam-confdir=/etc/pam.d \
   --with-dbus-sysconf-dir=/etc/dbus-1/system.d \
   --with-tracker-pkgconfig-version=3.0

The version 3.0 --with-tracker-pkgconfig-version=3.0 must match the pkg-config version of the installed Tracker libraries. Use the following commands for finding the version info:

$ pkg-config --list-all | grep tracker
...

On successful completion, you will see a report similar to the following:

Compilation summary:

   CPPFLAGS       = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)
   CFLAGS         = -D_U_="__attribute__((unused))" -g -O2
   LIBS           =  -lcrack
   PTHREADS:
       LIBS   = -lpthread
       CFLAGS = -pthread
   TRACKER:
       LIBS   = -ltracker-sparql-3.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
       CFLAGS = -I/usr/include/tracker-3.0 -I/usr/include/tracker-3.0/libtracker-sparql -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/json-glib-1.0 -I/usr/include/libxml2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -pthread
   SSL:
       LIBS   =  -L/usr/lib64 -lcrypto
       CFLAGS =  -I/usr/include/openssl
   LIBGCRYPT:
       LIBS   = -lgcrypt -lgpg-error
       CFLAGS =
   PAM:
       LIBS   =  -lpam
       CFLAGS =
   WRAP:
       LIBS   =
       CFLAGS =
   BDB:
       LIBS   =  -L/usr/lib64 -ldb-5.3
       CFLAGS =
   GSSAPI:
       LIBS   = -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
       CFLAGS =
   ZEROCONF:
       LIBS   =  -lavahi-common -lavahi-client
       CFLAGS =  -D_REENTRANT
   LDAP:
       LIBS   =  -lldap
       CFLAGS =
   LIBEVENT:
       LIBS   = -levent
       CFLAGS =
   TALLOC:
       LIBS   =
       CFLAGS =

Configure summary:

   INIT STYLE:
        redhat-systemd
   AFP:
        Extended Attributes: ad | sys
        ACL support: yes
        Spotlight: yes
   CNID:
        backends:  dbd last
   UAMS:
        DHX     (PAM SHADOW)
        DHX2    (PAM SHADOW)
        RANDNUM (afppasswd)
        Kerberos V
        clrtxt  (PAM SHADOW)
        guest
   Options:
        Zeroconf support:        yes
        tcp wrapper support:     no
        valid shell check:       yes
        cracklib support:        yes
        ACL support:             auto
        Kerberos support:        yes
        LDAP support:            yes
        AFP stats via dbus:      yes
        dtrace probes:           yes
   Paths:
        Netatalk lockfile:       /var/lock/netatalk
        init directory:          /usr/lib/systemd/system
        dbus system directory:   /etc/dbus-1/system.d
        dbus daemon path:        /bin/dbus-daemon
        tracker prefix:          /usr
        tracker install prefix:  /usr
        tracker manager:         /usr/bin/tracker3 daemon
        pam config directory:    /etc/pam.d
   Documentation:
        Docbook:                 no

Docbook is not needed because it is for developers only, when regenerating documentation.

Make and install.

$ make
# make install

Check

Check features and paths, using netatalk -V and afpd -V.

Setting

Edit /usr/local/etc/afp.conf.

Ex:

[Global]

[Homes]

   basedir regex = /home

[Test Volume]

   path = /export/test1

[My Time Machine Volume]

   path = /export/timemachine
   time machine = yes

You should check the firewall. AFP's port number is 548. Zeroconf's port number is 5353.

Enabling and Starting

# systemctl enable netatalk
# systemctl start netatalk

Netatalk v2

Netatalk 2.2 works well on Fedora (tested on Fedora 38 and 39 for x86-64) with just a few wrinkles. The steps are the same for Fedora Workstation and Fedora Server. This guide does not replace the full documentation; instead it supplements it.

Prepare the environment

First up, the prerequisites. Install them with this command:

dnf install openssl-devel libgcrypt-devel libdb-devel automake libtool avahi-devel cups-devel

Compiling and installing

After that, untar netatalk and go into its directory. (I'm using 2.2.10 here as an example, adjust the filenames as required for other versions).

Type tar jxvf netatalk-2.2.10.tar.bz2 to untar and then cd netatalk-2.2.10

When configuring, use the --enable-redhat-systemd option: ./configure --enable-redhat-systemd

Build netatalk (you can change the number 4 to the number of CPU cores you have to get the fastest possible compile): make -j4

And install (you must be root here or use sudo): make install

Some quick configuration examples

The configuration files after install can be found in /usr/local/etc/netatalk.

For afpd.conf, here's an example server line that I use.

"Gozer" -transall -uamlist uams_guest.so,uams_clrtxt.so,uams_dhx2.so

This names the server "Gozer" when it appears in the Chooser on connected Macs and allows either guest access or access by logging in with a valid username and password on your Fedora system. This works well for Mac System 7 and 8 clients (both real and emulated) all the way up to present day macOS Sonoma (press Command-K in the Finder and type afp:// followed by the IP address or DNS name of your Fedora system). If you are not going to connect with a System 7 client, it is strongly recommended to remove uams_clrtxt.so from your server config line for security reasons.

To set up shared volumes, edit AppleVolumes.default. Here is an example line that I use.

/data/A2 Apple_II

This causes a volume named "Apple_II" to appear to connected machines, and its files come from the UNIX path /data/A2.

Clone this wiki locally