How To Compile Amarok 2 From Git On Kubuntu 9.10 Karmic

Author: Stephan Jau
Revision: v1.1
Last Change: December 14 2009


Amarok is a great music player for linux. In the current reales of Kubuntu 9.10 Karmic also the current stable version of Amarok was introduced into the repositories. However Amarok is under heavy development and updates won't be included in the official repos. If you want to be up-to-date and have the latest Amarok version available, you'll need to compile it yourself. Compiling Amarok isn't really hard but there are a few dependencies that it needs and a few things to look out for.

This howto is based on my old howto for Kubuntu 8.10 Intrepid. Because of the the rapid development of Amarok the old howto is completely outdated. Most of the things in there remain still valid but also a lot of other things have changed. Most notably the change from SVN to Git.


1: Remove the current amarok installation

sudo apt-get purge amarok amarok-common

Instead of "purge" you can also use "remove". The difference is that purge will delete config and user data files (e.g. your statistics and stuff) - you may want to make a backup first.


2: Upgrade

I recommend to upgrade your system first:

sudo apt-get update && sudo apt-get upgrade


3: Install the required packages

Now install the required packages:

sudo apt-get install git-core build-essential kubuntu-restricted-extras kde-devel subversion libncurses5-dev libtag1-dev libqca2-dev libstrigiqtdbusclient-dev libstreamanalyzer-dev

Well, the kubuntu-restricted-extras package is not necessary per se but what good is a music player if you don't have the codecs to play music.


4: Extend your .bashrc and

You need to extend your .bashrc and files with a few things. Just run those commands:

KDE Users use this:

echo '' >> ${HOME}/.bashrc
echo 'export PATH=$HOME/kde/bin:$PATH' >> ${HOME}/.bashrc
mkdir -p ${HOME}/.kde/env
echo 'export KDEDIR=$HOME/kde' >> ${HOME}/.kde/env/
echo 'export KDEDIRS=$KDEDIR' >> ${HOME}/.kde/env/

Non-KDE Users use this:

echo '' >> ${HOME}/.bashrc
echo 'export PATH=$HOME/kde/bin:$PATH' >> ${HOME}/.bashrc
echo 'export KDEDIR=$HOME/kde' >> ${HOME}/.bashrc
echo 'export KDEDIRS=$KDEDIR' >> ${HOME}/.bashrc

And verify whether those were really added:

cat ${HOME}/.bashrc
cat ${HOME}/.kde/env/

If you're a non-KDE user, then only issue the first of those two commands


Step 5: Reload your .bashrc

Reload your .bashrc:

source ${HOME}/.bashrc


6: Create required folders

Create the required folders:

mkdir -p ${HOME}/kde/src
mkdir -p ${HOME}/kde/build/amarok


7: Download Amarok (necessary for compiling MySQL)

cd ${HOME}/kde/src
git clone git://


8: Download MySQL

MySQL is now integrated in Amarok 2 directly, this means we require the source for it. You can download MySQL here:

Or you can just run those commands:

cd ${HOME}/kde/src


9: Extract and compile MySQL

This is only applicable if you downloaded the mysql tar ball to the given location above and if you downloaded this exacte version. If necessary alter the path and version number:

tar xzvf mysql-5.1.40.tar.gz
cd mysql-5.1.40
cp -R ${HOME}/kde/src/amarok/supplementary_scripts/mysqle/* .

In case you got a multicore cpu or more cpus then you can change the number of cores to be used to compile. If you have a dual core then set the option below to "-j3". If you have a quadcore set it to "-j5". In rare cases there are problems by using multicore; if that's the case then just set it to "-j1":

export MAKEOPTS=-j2

Now you can compile MySQL (it will take quite a while):

./ --prefix=${HOME}/usr


10: Compile taglib-extras

This was also moved out of the Amarok Git repository and hence you'll have to compile it yourself:

cd ${HOME}/kde/src
svn co svn:// taglib-extras
cd taglib-extras
mkdir build
cd build
export LD_LIBRARY_PATH=${HOME}/kde/build/taglib-extras/taglib-extras
make install


11: Compile QtScriptGenerator

This has to be compiled also seperately. Get the sources:

cd ${HOME}/kde/src
tar xfvz qtscriptgenerator-src-0.1.0.tar.gz
cd qtscriptgenerator-src-0.1.0

However before you can compile it on Karmic, you'll have to patch it as Karmic uses GCC 4.4:

nano qtscriptgenerator.gcc-4.4.patch

Paste this text:

diff -uNr generator.orig/parser/rpp/pp.h generator/parser/rpp/pp.h
--- generator.orig/parser/rpp/pp.h	2008-12-05 11:01:44.000000000 +0100
+++ generator/parser/rpp/pp.h	2008-12-13 10:42:22.000000000 +0100
@@ -30,6 +30,7 @@
 #include <cctype>
 #include <fcntl.h>
+#include <cstdio>
 #ifdef HAVE_MMAP
 #  include sys/mman.h>

Save the file and run that command to patch the sources:

patch -p0 < qtscriptgenerator.gcc-4.4.patch

Now you can compile it and then generate the bindings:

export INCLUDE=/usr/include/qt4
cd generator
cd ../qtbindings

Copy the bindings now to the appropriate folder:

cd ../plugins/script
sudo cp -R * /usr/lib/qt4/plugins/script/


12: Enable additional Amarok plugins

If you want that Amarok can scrobble songs on last.fam you'll have to compile liblastfm on your own:

sudo apt-get install qt4-qmake pkg-config libsamplerate-dev libfftw3-dev ruby g++ libqt4-dev
cd ${HOME}/kde/src/
tar xvfj liblastfm-0.3.0.tar.bz2
cd liblastfm-0.3.0
./configure --release --prefix /usr/local
sudo make install

For the other plugins to work, you'll just have to install the appropriate packages. Below you have the list of the necessary packages for each plugin. Chose those that you want:

# libgpod - this also fulfills the requirements for Gdk
sudo apt-get install libgpod4 libgpod-dev
# libmtp
sudo apt-get install libmtp8 libmtp-dev
# curl
sudo apt-get install curl libcurl4-openssl-dev
# libxml2
sudo apt-get install libxml2 libxml2-dev
# loudmouth
sudo apt-get install libloudmouth1-0 libloudmouth1-dev


13: Compile Amarok

Finally we've reached the point where we're ready to start comiping Amarok:

cd ${HOME}/kde/src/amarok
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME}/kde -DCMAKE_BUILD_TYPE=debugfull ${HOME}/kde/src/amarok
make install

That should take some time now.


14: Update KDE config

Finally you'll have to update the KDE config:

kbuildsycoca4 --noincremental


15: Run Amarok

Now you can start Amarok from the command line:


Share this page:

6 Comment(s)

Add comment


From: Justen at: 2009-12-03 00:23:31

Thanks, you saved me a huge amount of time and frustration with this. Your patch didn't work on the version of qtscriptgenerator I ended up with (I believe there's a blank line between a couple items). I applied it manually though, no worries, seems to be working fine.

From: at: 2009-12-14 20:27:49

Yeah, the empty lines weren't just accepted by that. I had to modify the code here. It should now be correct. Thx for pointing that out.

From: Anonymous at: 2009-12-12 03:06:03

Awesome walk through, but just a heads up mysql is on version 5.1.41 now.

From: Anonymous at: 2009-11-16 03:11:53

This guide is for people that want to COMPILE THEIR OWN SOFTWARE, otherwise it is included by default. People that are new to linux shouldnt be trying to use cutting edge software anyway

From: Francesco at: 2011-06-14 13:06:53

You are right.  We shouldn't.  But then again, what if we want to?

Would you help a little?  S = H = A= R = E your knowledge to commoner?  Would u really? 

Surely doesn't  look like you are even trying.

Assuming that I am brainstorming on your prompts.

If running in Terminal, do I just copy and paste them?  Doesn't look like the case.

What about this prompt:

 cat ${HOME}/.bashrc  


 Copy & paste?? Don't think so. 




Would u really?


From: dragos at: 2009-11-10 10:56:15

This is why you feel like moving away from Linux, too much time lost in all these configurations.  You can do many things with this time rather than digging for howto, patches and other useless things in order to get Amarok to its latest version.