Apple Filing Protocol (AFP) File Server on Ubuntu using Netatalk

If you are using a Mac with OS X and want to take advantage of the performance and usability of AFP, you can install Netatalk  on an Ubuntu instance creating a very cost effective Apple file server.

To start off, install the folloing development packages:

sudo apt-get install devscripts dpkg-dev

Next, install a password checker and SSL library.

sudo apt-get install libcrack2-dev libssl-dev

Make a directory to hold the Netatalk source code, move to it, and download the code.

mkdir netatalk
cd netatalk
apt-get source netatalk

Move to the source code directory (the version number may change), resolve and install the build dependencies for Netatalk, and build with the SSL option enabled:

cd netatalk-2.2.x 
sudo apt-get build-dep netatalk
DEB_BUILD_OPTIONS=ssl debuild -i -us -uc -b
sudo debi

This command suppress updates of your custom Netatalk build. The program will break if Ubuntu tries to update it.

echo "netatalk hold" | sudo dpkg --set-selections

Any changes you would like to make to the directories presented when users connect, edit the following file.

sudo nano /etc/netatalk/AppleVolumes.default

Please note:
I came across a bug when installing installing NetaTalk 2.2.1. I fixed this by installing libacl1-dev

sudo apt-get install libacl1-dev

Ref: https://bugs.launchpad.net/ubuntu/+source/netatalk/+bug/808868/comments/1