Mario Fux

About Fellow No 1's life

KDE work day 9: Howto set up a KDE development environment (by Joel Bodenmann)

As I wrote yesterday today I’d like to share my blog with Joel and post his short article about how to setup a KDE development environment. This is partly based on several techbase pages but as KDE is currently in the process of migrating its version control infrastructure from Subversion to Git there are some new commands and URLs. Next week I’d like to write about my university projects and thus about more Sonnet and linguistics stuff.

But here goes Joel:

A few days ago, Mario and me set up our own KDE-Development-Environment. This guide shows, how you can setup your own KDE-Development-Enviroment, using the new git repositories.

Mario used the following commands under Debian, I used them under Kubuntu 10.10.

Step 1 – create user:

First of all, we need to setup a new development user called kde-devel. We do that, because this is easier with an extra user, and with this way, we can’t destroy our existing user.

  • $ sudo useradd -m kde-devel -s /bin/bash
  • $ sudo passwd kde-devel

Once we created the kde-devel user, we have to add the user in the sudoers file.

  • $ sudo visudo

Under the “User privilege specification” comment, we add the kde-devel user under the root entry:

# User privilege specification

root ALL=(ALL) ALL

kde-devel ALL=(ALL) ALL

This gives the kde-devel user all root privileges.

Now we have to copy the .bashrc from our existing user to the kde-devel user:

  • $ sudo cp ~/.bashrc /home/kde-devel/

We have to enhance the .bashrc from the kde-devel user with the bashrc from this link:

  • $ sudo kate /home/kde-devel/.bashrc // please choose your favorite editor (e.g. gedit, vi, nano…)

Step 2 – login:

We created a user and gave him root privileges. Now we can try to login with the kde-devel user to our local machine.

There are two different ways to do this. The first variante didn’t work for me.

  • $ su – kde-devel // didn’t work for me
  • $ ssh -X kde-devel@localhost // worked for me

Step 3 – Install packages:

When you are logged in successfully with the kde-devel user, we need to install a few developer packages. Visit the following page and install the packages under KDE 4.x and KDE 4.6 with aptitude or apt-get [or the package management tool on your system]: [Paragraph "Required packages from your distribution"]

I just linked this page, because the packages in the wiki may change.

Step 4 – Clone and build repositories

When you installed the packages, we can install qt-kde, soprano and kdelibs. For that, we clone the packages via git and compile them. This part may take some time. I did this on an i5 with 4GB of RAM and this step tooked me over one hour.

Install qt-kde:

  • $ cs // change to the src directory
  • $ git clone git://
  • $ cd qt-kde
  • $ ./configure – -prefix=$HOME/qt-copy // (remove the space between the two dashes
  • $ sudo make -j 2; if [ "$QTDIR" = "`pwd`" ]; then find . -name ‘*.o’ -delete; else make install; fi; // this takes a little while

Install soprano:

  • $ cs // change to the src directory
  • $ git clone git://
  • $ cd soprano
  • $ cmakekde

[You'll probably need further software from the kdesupport module like Phonon, Strigi, etc.]

Install kdelibs:

  • $ cs
  • $ git clone git://
  • $ cd kdelibs
  • $ cmakekde

Install kde-baseapps:

  • $ cs // change to the src directory
  • $ git clone git://
  • $ cd kde-baseapps
  • $ cmakekde

Install kde-workspace:

  • $ cs // change to the src directory
  • $ git clone git://
  • $ cd kde-workspace
  • $ cmakekde

Install kdelibs-runtime:

  • $ cs // change to the src directory
  • $ git clone git://
  • $ cd kde-runtime
  • $ cmakekde

[If you need Kate or Konsole, these are now in separate repositories.]

Step 5 – Enjoy:

Now your done. You setted up your basic development environment. Now you can start cloning existing projects and hack’em.

I hope that this guide was a bit helpfull for you.

Greetings Joel Bodenmann & Mario Fux

Flattr this

Tags: ,

12 Responses to “KDE work day 9: Howto set up a KDE development environment (by Joel Bodenmann)”

  1. sebas Says:

    Those two lines mismatch, should probably be the same:

    $ cd qt-kde
    $ ./configure –prefix=$HOME/qt-copy

  2. Joel Bodenmann Says:

    Hi sebas,

    That two lines are working, you just configure the qt-kde into a folder called qt-copy, because it is a copy.
    But you can name the folder like you want to:

    $ ./configure –prefix=$HOME/foldername

  3. Tweets that mention KDE work day 9: Howto set up a KDE development environment (by Joel Bodenmann) « Mario Fux -- Says:

    [...] This post was mentioned on Twitter by LinuxCommunity, Sarwo Hadi Setyana. Sarwo Hadi Setyana said: #KDE work day 9: Howto set up a KDE development environment [...]

  4. Nikhil Says:

    Great post about the new git way of doing things!

    Let me point out that there is no need to have a seperate user, and especially to give him root privileges. I have been running kde-trunk for more than a year now and hacking on it, from my normal account itself. I stick everything, sources, builds and installation into ~/kdedev and boot with a .xinitrc which sources the custom bashrc (I don’t stick the bashrc at the end of my .zshrc, I have kept it seperate in kdebashrc and it is NOT parsed by default, only when i manually invoke ‘source’) This way it is very convenient to work on KDE while still continuing to use your computer with same settings (chrome tabs, bookmarks, amarok playing your music and remembering your settings etc.) Since KDE has been very stable since 4.2, you don’t have to worry about it crashing, unless you manage to take down kdeinit4. If plasma or kwin or knotify dies, they can always be restarted.

    Just my 50 cents.

  5. arwa Says:

    Using your normal account can be problematic if systemsetting file formats change. The settings then work with the trunk version but maybe broken with the older installed KDE version.

    Also I would not recommend to give the devel-user root permissions! If a compiled/make-d module wants to install itself in the root filesystem this might be bad for the system, I think.


  6. Debianero Says:

    +1 for setting a separate dev user account
    -1 for giving root privilege to dev user by default

  7. Links 8/2/2011: Linux, Food for the Hungry Uses GNU/Linux, Mint 10 KDE is Coming | Techrights Says:

    [...] KDE work day 9: Howto set up a KDE development environment (by Joel Bodenmann) [...]

  8. Sam Tuke Says:

    really nice guide.

  9. Tulio Magno Says:

    Is it possible to compile KDE without root privileges?

  10. Joel Bodenmann Says:

    @ Tulio Magno:

    Yes, it should be to do that without root privileges.

  11. Tushar Mehta Says:

    Is there any particular reason for giving root access to kde-devel user?

    without giving root permission is not possible to create kde development environment?

  12. Badrinath Says:

    sudo kate /home/kde-devel/.bashrc This command dosent work for me. it says no such command as kate.

    what to do for this?

Leave a Reply