Monday, September 10, 2012

Linux Mint Debian Edition with Netatalk 3.0.1 for Mountain Lion 10.8 Support

I needed to share files with the macs i have in my house and i have a Brother DCP-7060D which has a scanner. It scans the files to the computer however i would still need to access it right? So i decided to set-up AFP on it. I installed the default netatalk 2.2.1 that was on the repository but then I decided to upgrade to netatalk 3.0.1 instead since a more updated release usually means more fixes and we all know of the problems with Lion and older netatalk versions. So if you're interested in using netatalk 3.0 then here's a short tutorial on how to compile it.

We'll need some of the libraries and header files to compile netatalk 3.0.1 Type this in a terminal.
sudo apt-get install libssl-dev libdb-dev libgcrypt-dev libcrack2-dev libavahi-client-dev libldap2-dev libacl1-dev libwrap0-dev checkinstall build-essential

So now the libraries are installed we need to get netatalk 3.0.1 sources.
cd ~
tar xvzf netatalk-3.0.1.tar.gz
cd netatalk-3.0.1

Now you need to configure the source files first
./configure --enable-debian --enable-zeroconf --with-cracklib --with-acls --with-ldap --enable-tcp-wrappers --with-init-style=debian

That should end properly with no errors stating what is supported whatsoever and now we compile it.

Once that is done we run checkinstall so we can properly remove it if needed.
sudo checkinstall --pkgname=netatalk --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no

After that is done, netatalk should be properly installed.

All the configuration is done in one file now which is really awesome. The file is afp.conf and it's located at /usr/local/etc/afp.conf. We'll edit the configuration file and add in some stuff.
sudo nano /usr/local/etc/afp.conf

This is my personal configuration file and you can modify it as necessary.
Here's more info about how to modify afp.conf


So once you have your afp.conf configured you'll need to restart netatalk.
We do this with this command
sudo service netatalk restart

Oh and one more thing. To get netatalk to start on boot, run these commands:
sudo update-rc.d -f netatalk remove
sudo update-rc.d netatalk defaults

Feel free to add any extra volumes according to the configuration file. You're basically done. If you're lazy and don't want to compile it. I've compiled a .deb file already and you can get it from the link below. It's 32bit only. Cheers.

Compiled only the 32bit 3.0.1 version.

EDIT: 3.0.2 is out. Haven't tested it but the steps should be the same.

Download: 32bit


  1. Thank you very much :)

  2. hi - isn't avahi daemon necessary anymore?

  3. Avahi daemon is still necessary. The only difference now is Avahi is automatically configured by netatalk so you don't have to mess with any pesky Avahi configuration files.

  4. Thanks for helping people with a nicely written guide. Just one thing: DO NOT USE 3.0. It has a data corruption bug where files without extended attributes are incorrectly refcounted. I don't want to go into details, it takes way too much prerequisite knowledge about netatalk internals to explain.

    Just know that 3.0 should NOT be used under ANY circumstances, and that 3.0.1 fixes this severe bug. Delete your 3.0 package above so that people don't install it.

    You might also want to clean up the guide by removing all your outdated 3.0 workarounds since they are no longer needed.

  5. This tutorial was invaluable in helping me set up my Debian TimeMachine server. Thank you so much!

  6. I'm getting a weird error. I have libpam-cracklib installed but the .configure script reports an error:

    checking for main in -lcrack... no
    configure: error: cracklib not found!

    My upgrade ground to a halt.

    Lubuntu 12.10 (powerpc) running netatalk 2.2.2 just fine.

    1. If I remember correctly, that error comes from not having the cracklib headers. But you can just build netatalk 3.0 without cracklib, I don't think you'll use it. So just omit the part --with-cracklib from the build statement.

  7. Got the following error... Any thoughts?

    In file included from netatalk.c:46:0:
    ../../libevent/include/event2/event.h:187:33: fatal error: event2/event-config.h: No such file or directory
    compilation terminated.
    make[2]: *** [netatalk-netatalk.o] Error 1
    make[2]: Leaving directory `/root/netatalk-3.1-beta1/etc/netatalk'
    make[1]: *** [install-recursive] Error 1
    make[1]: Leaving directory `/root/netatalk-3.1-beta1/etc'
    make: *** [install-recursive] Error 1

    **** Installation failed. Aborting package creation.

    1. Dear Anon, It looks as though to me you are missing the header files for libevent.

      Try installing the package 'libevent-dev' or the equivalent on your distribution

  8. On Linux Mint 15 Olivia, works like a charm. Thanks a lot for the guide.
    A little note addendum: if you name the ATalk server machine using the same name of the Samba or NFS server, you will see on the Macs only one machine name. To name the server edit the netatalk.conf in:
    ; Global server settings
    hostname = %hostname%

  9. Hi Zane,
    Thanks for the quick response!
    There was a little bit of a version inconsistency on my debian system....
    Thanks for your help!

  10. I have a lot of issues in getting netatalk functionalities to work in Debian wheezy. I installed Netatalk 3. I have few queries.
    1. Can i use mDNSresponder as an alternative to Avahi...?
    2. Is "unix prev=yes" really necessary...?
    3. Main thing is Spotlight.. Will Spotlight work for all volumes or only for HFS supported volumes.?
    In my case, i am able to search for the files in my linux volumes in Finder Search window but not in Spotlight(cmd+space) in Mac.

    I request you to help me in this regard.

  11. Thanks for the tutorial! I pulled the latest Netatalk (3.1.6) and ran into an issue.. configure bombed out with the error:

    configure: error: --with-init-style=debian is obsoleted. Use debian-sysv or debian-systemd.

    I learned the hard way (by choosing incorrectly the first time) that on Linux Mint 17, at least, I needed to specify --with-init-style=debian-sysv instead of --with-init-style=debian

    I should clarify that I was able to get it compiled and started... I actually haven't tested it yet.