Home > Asterisk, Linux, Ubuntu > Installing Asterisk on Ubuntu Server 9.04

Installing Asterisk on Ubuntu Server 9.04

There are numerous sites and install guides out there detailing how to set-up Asterisk on Ubuntu. However most are either overly complicated, going into far too much detail for the purpose of installation, and others or not detailed enough, missing out steps and descriptions.

Here is my attempt at writing a usable guide…

Note: The text in quotes (like this) can be copied directly to the command line.
If there are multiple lines do them one at a time.

1)  System Set-up

I am assuming you have a fresh installation of Ubuntu 9.04 Server, if not you may already have these packages installed.

Ok, the first thing we need to do is get a few packages:

apt-get install subversion make linux-source kernel-package

We then need to get the “linux-kernel-headers” package. This is done in two steps:

apt-get install linux-kernel-headers

This command should return a message something like this:

...
Package linux-kernel-headers is a virtual package provided by:
 linux-libc-dev 2.6.28-13.45
You should explicitly select one to install.
...

So go ahead and install the suggested package:
(Remember to drop the version info ‘2.6.28-13.45’)

apt-get install linux-libc-dev

Next we need to install “linux-headers”. Again this is in two steps:

apt-get install linux-headers

You should get a message back similar to:

...
Package linux-headers is a virtual package provided by:
 linux-headers-2.6.28-13-server 2.6.28-13.45
 linux-headers-2.6.28-13-generic 2.6.28-13.45
 linux-headers-2.6.28-13 2.6.28-13.45
 linux-headers-2.6.28-3-rt 2.6.28-3.12
 linux-ports-headers-2.6.28-6 2.6.28-6.20
 linux-headers-2.6.28-6-386 2.6.28-6.20
 linux-headers-2.6.28-11-server 2.6.28-11.42
 linux-headers-2.6.28-11-generic 2.6.28-11.42
 linux-headers-2.6.28-11 2.6.28-11.42
You should explicitly select one to install.
...

Install the two “server” packages:

apt-get install linux-headers-2.6.28-13-server
apt-get install linux-headers-2.6.28-11-server

We then need to install a few more packages:

apt-get install libconfig-tiny-perl libcupsimage2 libcups2 libmime-lite-perl libemail-date-format-perl libfile-sync-perl libfreetype6 libspandsp1 libtiff-tools libtiff4 libjpeg62 libmime-types-perl libpaper-utils psutils libpaper1 ncurses-dev libncurses-dev libncurses-gst ncurses-term libnewt-dev libnewt-pic libxml2 libxml2-dev libspandsp-dev libspandsp1

2) Install Asterisk

First move to the correct directory:

cd /usr/src/

Now we can check out the source files:

svn co http://svn.digium.com/svn/asterisk/trunk asterisk
svn co http://svn.digium.com/svn/dahdi/linux/trunk dahdi-kernel
svn co http://svn.digium.com/svn/dahdi/tools/trunk dahdi-tools
svn co http://svn.digium.com/svn/libpri/branches/1.4/ libpri

We can then build them, starting with “libpri”:

cd /usr/src/libpri
make clean
make
make install

Then “DAHDI kernel”:

cd /usr/src/dahdi-kernel
make clean
make
make install

Then “DAHDI tools”:

cd /usr/src/dahdi-tools
make clean
./configure
make
make install
make config

And finaly “Asterisk”:

cd /usr/src/asterisk
make clean
 ./configure
 make
 make install
 make config

That should be it, restart the server and away you go. All you have to do next is configure Asterisk (that is for another post)…

Categories: Asterisk, Linux, Ubuntu Tags:
  1. mtucker
    January 2nd, 2010 at 02:20 | #1

    I have hit a stump trying to follow your asterisk installation. It is probably my lack of knowledge at the command line. Here is the script from the terminal session. What next???

    root@mtucker-desktop:~# apt-get install linux-kernel-headers
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package linux-kernel-headers is a virtual package provided by:
    linux-libc-dev 2.6.31-16.53
    You should explicitly select one to install.
    E: Package linux-kernel-headers has no installation candidate
    root@mtucker-desktop:~# apt-get install linux-libc-dev 2.6.31-16.53
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Couldn’t find package 2.6.31-16.53

  2. January 2nd, 2010 at 14:08 | #2

    @mtucker
    Hi, sorry for the confusion… This is something I have been wanting to update for a while…

    After running the command:
    # apt-get install linux-kernel-headers

    You need to run something like this:
    # apt-get install linux-libc-dev 2.6.31-16.53

    I will update the original post a.s.a.p.

  3. mtucker
    January 2nd, 2010 at 15:37 | #3

    I entered :
    # apt-get install linux-libc-dev 2.6.31-16.53
    and got:
    E: Couldn’t find package 2.6.31-16.53

  4. January 2nd, 2010 at 21:26 | #4

    @mtucker
    That’s me being a numpty! (again…)

    # apt-get install linux-libc-dev

    Leave off the “2.6.31-16.53”

    Hope it helps…

  5. gosmardi
    April 13th, 2010 at 09:41 | #5

    Hi Philip, thats a lot for your suggestions. I’ve followed your procedure, but I still face with the following issue trying to complile the dahdi:

    /usr/src/dahdi-linux-complete-2.2.1.1+2.2.1.1# make
    make -C linux all
    make[1]: Entering directory `/usr/src/dahdi-linux-complete-2.2.1.1+2.2.1.1/linux’
    make -C drivers/dahdi/firmware firmware-loaders
    make[2]: Entering directory `/usr/src/dahdi-linux-complete-2.2.1.1+2.2.1.1/linux/drivers/dahdi/firmware’
    make[2]: Leaving directory `/usr/src/dahdi-linux-complete-2.2.1.1+2.2.1.1/linux/drivers/dahdi/firmware’
    You do not appear to have the sources for the 2.6.28-11-server kernel installed.
    make[1]: *** [modules] Error 1
    make[1]: Leaving directory `/usr/src/dahdi-linux-complete-2.2.1.1+2.2.1.1/linux’
    make: *** [all] Error 2

    But I’m sure the sources are installed… Indeed:
    apt-get install linux-headers-2.6.28-11-server
    linux-headers-2.6.28-11-server is already updated to the most recent one.

    apt-get install linux-source-2.6.28
    apt-get install linux-source-2.6.28 is already updated to the most recent one.

    Any further suggestions please ?

  1. No trackbacks yet.
You must be logged in to post a comment.