Monday, January 07, 2008

nzbget install on ubuntu server

I've just beefed up my home server a bit to replace some old (and gradually failing kit) as well as attempt to make the box a bit quieter. When setting up a new server every time I come around to installing nzbget I can never remember all the libraries which it needs. This isn't so much a how-to but a note to my future self on what I need to do. I've setup the box with a clean install of the 64 bit version of Ubuntu Server. I'm slowly adding all of the software which I use so there's not much that's already been installed.

First things first we need to get a copy of nzbget:
:> wget http://dfn.dl.sourceforge.net/sourceforge/nzbget/nzbget-0.3.0.tar.gz

Then after untarring and changing to the new nzbget folder we can run the configure script and see what's missing:
:> ./configure
checking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.


Ah, we don't have a C compiler, I would have thought that it would have come as part of the default install, but nevermind:
:> sudo apt-get install g++

Now that we've got the compiler lets try again:
:> ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
...
checking libxml/tree.h usability... no
checking libxml/tree.h presence... no
checking for libxml/tree.h... no
configure: error: "libxml2 header files were not found."


Right, first missing package libxml2. I remember from previous installs that nzbget requires some development libraries, I too lazy to work out which ones so I'm just going to install them for each library:
:> sudo apt-get install libxml2-dev

Let's try running the configuration script again:
:> ./configure
...
checking ncurses.h usability... no
checking ncurses.h presence... no
checking for ncurses.h... no
checking ncurses/ncurses.h usability... no
checking ncurses/ncurses.h presence... no
checking for ncurses/ncurses.h... no
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
configure: error: Couldn't find curses headers (ncurses.h or curses.h).


After a quick google search for the appropriate package we're good to install it:
:> sudo apt-get install libncurses5-dev

We then run through the same process for libpar2 and libsigc++-2.0:
:> ./configure
...
checking sigc++/type_traits.h usability... no
checking sigc++/type_traits.h presence... no
checking for sigc++/type_traits.h... no
configure: error: "libsigc++-2.0 header files were not found in /usr/include/sigc++-2.0."

:> sudo apt-get install libsigc++-2.0-dev

:> ./configure
...
checking libpar2/libpar2.h usability... no
checking libpar2/libpar2.h presence... no
checking for libpar2/libpar2.h... no
configure: error: "libpar2 header files were not found in /usr/include."

:> sudo apt-get install libpar2-0-dev


Once those two are installed we can run the configuration script again:
:> ./configure
...
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands


Excellent, we have everything that we need. Now we can run the makefile and install nzbget:
:> make
The program 'make' is currently not installed. You can install it by typing:
sudo apt-get install make
-bash: make: command not found


Well, we would if make was installed...
:> sudo apt-get install make

And try again:
:> make
/usr/bin/make all-am
make[1]: Entering directory `/home/neil/nzbget-0.3.0'
make[1]: Leaving directory `/home/neil/nzbget-0.3.0'

:> sudo make install
[sudo] password for neil:
make[1]: Entering directory `/home/neil/nzbget-0.3.0'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
/usr/bin/install -c 'nzbget' '/usr/local/bin/nzbget'
make[1]: Nothing to be done for `install-data-am'.


nzbget should now be successfully installed. All that's needed is to create a config file and add your settings:
:> cp nzbget.conf.example ~/.nzbget

:> vi ~/.nzbget


This probably isn't a complete run through of everything that's needed or might crop up, it's just what worked for me. We can put everything from above into a more sensible order and save ourselves running the configuration script so many times.

:> sudo apt-get install g++ libxml2-dev libncurses5-dev libsigc++-2.0-dev libpar2-0-dev make
:> ./configure
:> make
:> sudo make install

7 comments:

Calum said...

As well as the various specific libraries you needed, the package you really wanted was:

build-essential

It installs the basic packages required to compile and build standard C/C++ stuff. It's not included by standard because most people don't need to do that.

Neil said...

I had forgotten about build-essential, that would certainly save installing g++ and make. I would have thought that anyone running the server version will need them at some point and would want them installed by default.

Calum said...

Nah, if you're just installing a normal server you don't need them (almost all server components are APT-deployable, remember, and if you really need custom components creating your own .debs bears serious thinking about). It's kinda surprising how little you actually need to build for yourself these days, actually.

The server install is intended to be a blank canvas, in any case; build tools are not required for deployment servers in a lot of cases, so they're not included.

Bryan said...

nzbget is sooo last season ;-) Check out sabnzb+ at http://www.sabnzbd.org/

EnricoM said...

Thanks for your instructions. I managed to make a working nzbget program for my NAS (Conceptronic CH3SNAS). Because I don't have a linux desktop I did everything on the NAS it self (in a chrooted debian etch environment).

cyrille said...

need also to install libssl-dev

Anonymous said...

Thanks, I did all that (Not installing make and g++ seperated, but just build-essential) i was searching for libpar ;), Thanks. You've saved me time to find this!

At the end, i noted the title "On ubuntu server", its the same on the desktop version :/ (too badly)

(By Sp00K . newton [nospam_replace_with_@] wayhost [dot...] eu)

:)