Skip to content

Instantly share code, notes, and snippets.

Forked from mAAdhaTTah/
Last active August 31, 2023 21:50
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dinigo/321c026fa57f6413adbf to your computer and use it in GitHub Desktop.
Save dinigo/321c026fa57f6413adbf to your computer and use it in GitHub Desktop.
Install netatalk (afp) in Ubuntu with service announcing and provide a Time Machine share. Users must belong to `timemachine` group to be allowed to use it.
path = /store/time-machine
time machine = yes
valid users = @timemachine
# This script will install the latest stable version of netatalk 3.x and libevent in order
# to configure a Time machine volume
# Versions to use
# Install prerequisites:
apt-get install build-essential pkg-config checkinstall git avahi-daemon libavahi-client-dev libcrack2-dev libwrap0-dev autotools-dev automake libtool libdb-dev libacl1-dev libdb5.3-dev db-util db5.3-util libgcrypt11 libgcrypt11-dev libtdb-dev
# libevent
cd /usr/local/src
tar xfv libevent-${libevent_version}.tar.gz
cd libevent-${libevent_version}
checkinstall \
--pkgname=libevent-${libevent_version} \
--pkgversion=${libevent_version} \
--backup=no \
--deldoc=yes \
--default --fstrans=no
cd ../
# netatalk
git clone git:// netatalk-code
cd netatalk-code
git checkout netatalk-${netatalk_version}
./configure \
--enable-debian \
--enable-krbV-uam \
--enable-zeroconf \
--enable-krbV-uam \
--enable-tcp-wrappers \
--with-cracklib \
--with-acls \
--with-dbus-sysconf-dir=/etc/dbus-1/system.d \
--with-init-style=debian-sysv \
--with-pam-confdir=/etc/pam.d \
checkinstall \
--pkgname=netatalk \
--pkgversion=${netatalk_version} \
--backup=no \
--deldoc=yes \
--default \
# Install time machine configuration
cp afp.conf /usr/local/etc/
# Start services
service avahi-daemon start
service netatalk start
# Instruct User
echo "************************************"
echo "************************************"
echo " To add users to your Time Machine symply"
echo " simadd them to the timemachine group by"
echo " running the following command as root:"
echo " sudo usermod -a -G timemachine <username>"
echo " Afterwards they can log in the Time Machine"
echo " volume with their linux user and password"
echo "------------------------------------"
echo " CONFIG FILE: /usr/local/etc/afp.conf"
Copy link

dinigo commented Feb 8, 2015

fixed several typos and fixed lib event download link, thanks to @odarriba

Copy link

d2s commented May 15, 2016

Had to modify the original install script since it lacked some of the required packages.


  • Add missing libtool-bin libkrb5-dev packages so that compiling works.
  • Update libgcrypt11 libgcrypt11-dev to libgcrypt20 libgcrypt20-dev version since old one was removed from Ubuntu 16.04 packages.
  • Update libevent download path from SourceForge to GitHub because the URL was not responding anymore.
  • Disable (comment out) cp afp.conf /usr/local/etc/ because it failed the install script because script is at different directory when it is run (because cd netatalk-code had moved it to that location, away from the original afp.conf disk location).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment