You are here

Generic installation instructions

Primary tabs

First, in addition to the GNUnet sources you must download the latest version of various dependencies. Most distributions do not include sufficiently recent versions of these dependencies. Thus, a typically installation on a "modern" GNU/Linux distribution requires you to install the following dependencies (ideally in this order):

  • libgpgerror and libgcrypt
  • libnettle and libunbound (possibly from distribution), GnuTLS
  • libgnurl (read the README)
  • GNU libmicrohttpd
  • GNU libextractor (make sure to first install the various mandatory and optional dependencies including development headers from your distribution)

Other dependencies that you should strongly consider to install is a database (MySQL, sqlite or Postgres). The following instructions will assume that you installed at least sqlite. For most distributions you should be able to find pre-build packages for the database. Again, make sure to install the client libraries and the respective development headers (if they are packaged separately) as well.

You can find specific, detailed instructions for installing of the dependencies (and possibly the rest of the GNUnet installation) in the platform-specific descriptions, which are linked from the bottom of this page. Please consult them now. If your distribution is not listed, please study the instructions for Debian stable carefully as you try to install the dependencies for your own distribution. Contributing additional instructions for further platforms is always appreciated.

Before proceeding further, please double-check the dependency list. Note that in addition to satisfying the dependencies, you might have to make sure that development headers for the various libraries are also installed. There maybe files for other distributions, or you might be able to find equivalent packages for your distribution.

While it is possible to build and install GNUnet without having root access, we will assume that you have full control over your system in these instructions. First, you should create a system user "gnunet" and an additional group "gnunetdns". On Debian and Ubuntu GNU/Linux, type:

# adduser --system --home /var/lib/gnunet --group --disabled-password gnunet
# addgroup --system gnunetdns

On other Unixes, this should have the same effect:

# useradd --system --groups gnunet --home-dir /var/lib/gnunet
# addgroup --system gnunetdns

Now compile and install GNUnet using:

$ tar xvf gnunet-0.10.?.tar.gz
$ cd gnunet-0.10.?
$ ./configure --with-sudo=sudo --with-nssdir=/lib
$ make
$ sudo make install

If you want to be able to enable DEBUG-level log messages, add --enable-logging=verbose to the end of the ./configure command. DEBUG-level log messages are in English-only and should only be useful for developers (or for filing really detailed bug reports).

Finally, you probably want to compile gnunet-gtk, which includes gnunet-setup (graphical tool for configuration) and gnunet-fs-gtk (graphical tool for file-sharing):

$ tar xvf gnunet-gtk-0.10.?.tar.gz
$ cd gnunet-gtk-0.10.?
$ ./configure --with-gnunet=/usr/local/
$ make
$ sudo make install
$ cd ..
$ sudo ldconfig # just to be safe

Now, edit /etc/gnunet.conf to contain the following:

[arm]
SYSTEM_ONLY = YES
USER_ONLY = NO

You may need to update your ld.so cache to include files installed in /usr/local/lib:

# ldconfig

Then, switch from user root to user gnunet to start the peer:

# su -s /bin/sh - gnunet
$ gnunet-arm -c /etc/gnunet.conf -s

You may also want to add the last line in the gnunet users crontab prefixed with @reboot so that it is executed whenever the system is booted:

@reboot /usr/local/bin/gnunet-arm -c /etc/gnunet.conf -s

This will only start the system-wide GNUnet services. Type exit to get back your root shell. Now, you need to configure the per-user part. For each $USER on the system, run:

# adduser $USER gnunet

to allow them to access the system-wide GNUnet services. Then, each user should create a configuration file "~/.config/gnunet.conf" with the lines:

[arm]
SYSTEM_ONLY = NO
USER_ONLY = YES
DEFAULTSERVICES = gns

and start the per-user services using

$ gnunet-arm -c ~/.config/gnunet.conf -s

Again, adding a crontab entry to autostart the peer is advised:

@reboot /usr/local/bin/gnunet-arm -c $HOME/.config/gnunet.conf -s

Note that some GNUnet services (such as SOCKS5 proxies) may need a system-wide TCP port for each user. For those services, systems with more than one user may require each user to specify a different port number in their personal configuration file.

Finally, the user should perform the basic initial setup for the GNU Name System. This is done by running two commands:

$ gnunet-gns-import.sh
$ gnunet-gns-proxy-setup-ca

The first generates the default zones, wheras the second setups the GNS Certificate Authority with the user's browser. Now, to actiave GNS in the normal DNS resolution process, you need to edit your /etc/nsswitch.conf where you should fine a line like this:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

The exact details may differ a bit, which is fine. Add the text "gns
[NOTFOUND=return]" after files:

hosts:          files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4

You might want to make sure that /lib/libnss_gns.so.2 exists on your system, it should have been created during the installation.

Comments

I had most of it down okay, but ran into a few problems of which were solved with this:

libextractor needed to be compiled like so:

CFLAGS="-I/usr/local/include" ./configure --with-ltdl-include=/usr/local/include --with-ltdl-lib=/usr/local/lib

GNUnet kept failing complaining it couldn't find extractor so this is what ended up working for me:

CFLAGS="-I/usr/local/include" ./configure --with-ltdl-include=/usr/local/include --with-ltdl-lib=/usr/local/lib --with-extractor=/usr/local

Hope that helps someone!