Gentoo Logo

Gentoo KDE Guide

Content:

1.  KDE 3

Quick Information

KDE 3 is no longer maintained by upstream, with 3.5.10 being their last release. Also, most KDE 3 applications aren't maintained any more, as they already have been or are currently being ported to KDE 4.

In Gentoo, KDE 3 ebuilds have been removed from the Portage tree, and they have been moved to the user-maintained overlay called kde-sunset (available in layman). Keep in mind that this overlay is user-maintained only, and current KDE team members have no responsibility for its content. If you are interested in co-maintaining it, you can send an email to overlays asking for commit access. If you want to report a bug about this overlay, please don't file a bug in Gentoo's Bugzilla. Instead, use the gentoo-desktop mailing list. Instructions on how to subscribe can be found here.

2.  KDE SC 4

Introduction

KDE SC 4 is the current KDE version supported by upstream. In Portage there is a stable version, and there might be one (or more) non-stable versions. Under normal conditions new versions get in stabilized after a month. The KDE SC 4 version available through Portage is 4.4.5 (stable by both upstream and Gentoo). In addition, KDE upstream provides weekly snapshots, and a live SVN tree. The Gentoo KDE team provides the snapshots, trunk and latest branch live ebuilds, through the kde overlay.

Choose what KDE SC version is most appropriate for you:

KDE SC from Portage (stable: 4.4.5, testing: 4.5.1)
KDE live ebuilds (currently 4.4.9999, 4.5.9999, 9999)

Installing KDE SC 4.4.5 or 4.5.1 (from Portage)

Note: In order to minimize issues it is recommended to start with a clean environment. Read more in Cleaning Up KDE section.

KDE SC 4.4.5 is the currect stable release.

Code Listing 2.1: Installation of KDE SC 4.4.5 using meta packages

# emerge -av kde-meta (contains all of KDE modules)
# emerge -av kdebase-meta kdegames-meta (installation of chosen modules only)

KDE SC 4.5.1 is also in portage, but currently testing and also hardmasked. The hardmask will be removed as soon as bug 336158 is fixed. Users of amd64/x86 architectures can manually unmask and use it without problems though. To unmask it quickly, you will need to put this unmask file in /etc/portage/package.unmask. Users with stable systems also need to put this keywords file in /etc/portage/package.keywords.

Code Listing 2.2: Installation of KDE SC 4.5.1 using meta packages

# emerge -av kde-meta (contains all of KDE modules)
# emerge -av kdebase-meta kdegames-meta (installation of chosen modules only)

Note: KDE SC 4.5 will never go stable though. Reasons are explained on September's meeting summary.

For installation using sets instead of the meta packagescheck the Using Sets section.

Installing KDE SC live ebuilds (from kde overlay)

Warning: KDE live ebuilds are bleeding edge. Use at your own risk.

KDE SC is Open Source, with its code being available for browsing through KDE Websvn, and for public checkout through an anonymous (anonsvn) account. Gentoo, as a source based distro, has the ability to provide live ebuilds that checkout the code either from the latest branch or from trunk. Currently, we provide 4.4.9999 ebuilds from 4.4 branch.

Ebuilds version KDE SC ersion
4.4.9999 KDE 4.4 Branch
4.5.9999 KDE 4.5 Branch
9999 KDE 4 Trunk

Note: In order to minimize issues it is recommended to start with a clean environment. Read more in Cleaning Up KDE section.

Note: You'll need portage-2.2_rc*, so please add sys-apps/portage entry in your /etc/portage/package.unmask file.

Live ebuilds are only available through kde overlay, so first thing is to install it:

Code Listing 2.3: Installing kde overlay

# layman -f -a kde
For more information regarding overlays, please read the Overlay Guide

Users with stable systems have to keyword the packages to proceed. We provide a package.keyword file in kde overlay, which we'll have to symlink to our package.keywords directory:

Code Listing 2.4: Creating symlink of the kde-4.X.9999.keywords or kde-live file

# cd /etc/portage/package.keywords
# ln -s /path/to/overlay/kde/Documentation/package.keywords/kde-4.4.9999.keywords .(for 4.4 Branch)
# ln -s /path/to/overlay/kde/Documentation/package.keywords/kde-4.5.9999.keywords .(for 4.5 Branch)
# ln -s /path/to/overlay/kde/Documentation/package.keywords/kde-live.keywords .(for KDE Trunk)

The installation can be done either by using the meta packages or by using sets.

Code Listing 2.5: Installation of KDE live ebuilds using meta packages

(For KDE SC 4.4 Branch)
# emerge -av kde-meta:4.4 (contains all of KDE modules)
# emerge -av kdebase-meta:4.4 kdegames-meta:4.4 (installation of chosen modules only)
(For KDE SC 4.5 Branch)
# emerge -av kde-meta:4.5 (contains all of KDE modules)
# emerge -av kdebase-meta:4.5 kdegames-meta:4.5 (installation of chosen modules only)
(For KDE SC Trunk)
# emerge -av kde-meta:live (contains all of KDE modules)
# emerge -av kdebase-meta:live kdegames-meta:live (installation of chosen modules only)

Code Listing 2.6: Installation of KDE live ebuilds using sets

(For KDE SC 4.4 Branch)
# emerge -av @kde-4.4 (contains all of KDE modules)
# emerge -av @kdebase-4.4 @kdegames-4.4 (installation of chosen modules only)
(For KDE SC 4.5 Branch)
# emerge -av @kde-4.5 (contains all of KDE modules)
# emerge -av @kdebase-4.5 @kdegames-4.5 (installation of chosen modules only)
(For KDE SC Trunk)
# emerge -av @kde-live (contains all of KDE modules)
# emerge -av @kdebase-live @kdegames-live (installation of chosen modules only)
See the Using Sets section for more information.

Installation of KDE 4 Applications

In kde you may find live ebuilds of KDE 4 applications. These are slotted in :4, but they can not be installed in parallel with normal ones. You are free though to use live KDE 4 applications with KDE 4 from Portage, or to use Portage KDE 4 applications with your live KDE.

Note: There is also a set with live KDE 4 applications, @kde-extras-live and a set with live KOffice @koffice-live, in kde overlay, and a set with Qt live applications, @qt-extras-live, in qting-edge overlay.

3.  Additional Installation/Removal Information

Using Sets

Warning: Portage 2.2_rcX is currently masked. So if you want to use sets please unmask it by adding sys-apps/portage in your /etc/portage.package.unmask file.

One of the new features provided by Portage 2.2 is sets.

Sets allow the KDE team to provide a complete replacement for the monolithic packages, with the added bonus that users may choose to remove from the default sets any packages they do not want. There is still some discussion going on before we can put sets in the Portage tree. Thus, grab the sets from the kde overlay sets directory or grab them as a tar.bz2 archive and put the ones you like in /etc/portage/sets -- you can browse the list of sets provided by the KDE team in the overlay by using the first link.

Note: If you are using the kde overlay you can use sets directly instead of copying them to /etc/portage/sets.

Amongst others, there are sets for each KDE tarball - @kdeaccessibility, @kdeadmin, @kdeartwork, @kdebase, @kdeedu, @kdegames, @kdegraphics, @kdemultimedia, @kdenetwork, @kdepim, @kdesdk, @kdetoys, and @kdeutils. There is also a set of sets (the equivalent to the old kde-meta package) @kde, and the same for specific versions @kde-3.5 and @kde-4x, a set for KDE deps @kdedeps, a set for optional packages @kdeoptional and a set for the split qt packages @qt-split.

One can install the complete KDE by running emerge -av @kde. The specific version equivalents are very useful to uninstall an old version, e.g. emerge -C @kde-3.5, or to reinstall all packages from a specific version, e.g. emerge -av1 @kde-4x. Advanced features, like removing any unwanted packages from a set, will be supported in a future release of Portage -- you can read more about it in Marius Mauch's (genone) blog. Part of this code has now been released in portage-2.2_rc12, so you can reinstall all installed packages of a set with emerge -av @<set>/@installed or to have a /etc/portage/sets/kdebase-unwanted set and then run emerge -av @kdebase-@kdebase-unwanted.

We strongly recommend that you install the kdebase set in order to get a full KDE 4 session. The example below would install the kdebase set and the kdegames set.

Code Listing 3.1: Installing KDE SC

# emerge @kdebase @kdegames

Note: If you want to check the list of sets known to Portage run the following: emerge --list-sets

Note: All >= KDE 4.1 ebuilds require sys-apps/portage-2.1.6 or greater, which has implemented everything in the new EAPI 2 specification used in these ebuilds (>=sys-apps/portage-2.2_rc12 is required to use sets).

Cleaning Up KDE

In order to minimize issues, it is best to begin with a clean environment. This is recommended for the following cases:

  • Moving from +kdeprefix to -kdeprefix (and vice versa)
  • Downgrading KDE (eg. from snapshots/live ebuilds to the Portage version)
  • Fully upgrading from KDE 3 to KDE 4 (and vice versa)
  • Moving from an old overlay

Two possible ways of removing old KDE installations are:

Code Listing 3.2: Unmerging commands

# emerge -C @kde-4.X @kdebase-4.X @kde-3.5(using the typical sets)
# emerge -C $(qfile -C -q -e /usr/kde/%PREFIX%) (replace %PREFIX% with your KDE version, eg. 3.5, 4)

Code Listing 3.3: Unmerging commands (only applicable if you are moving from an overlay)

# cd /path/to/overlay/
# emerge -C $(find ./ -name \*.ebuild |sed -e "s:\.ebuild$::" -e "s:./::" |awk -F'/' '{print "="$1"/"$3}')

As a final step you should remove the old overlay so that there are no conflicts with the KDE ebuilds. You should remove the old unmask and/or keyword data, too.

Note: Don't forget to run emerge --depclean in order to uninstall any dependant packages.

Rebuilding the application database

To rebuild the KDE application database run:

Code Listing 3.4: kbuildsycoca command

# kbuildsycoca4 --noincremental

Localization/Internationalization

With new KDE there is new translators effort in Localization instead of Internationalization. This cause some confusion, but don't worry; just the name has been changed.

Code Listing 3.5: Getting the translations

For KDE 4 and KOffice 2:
# emerge kde-l10n
# emerge koffice-l10n

Migrating configs from 3.5 to 4.X

KDE stores its configuration files in the ~/.kde directory by default. In the Gentoo ebuilds this has been changed in KDE 4.X to allow for better integration of KDE 3.5 and 4.X when using the same user account. If you export $KDEHOME this behaviour will be overridden. It is strongly recommended that you do not do this. $KDEHOME will make KDE 3.5 and 4.X use the same configuration directory which is usually not desired.

KDE 3.5 uses ~/.kde and the default FHS (-kdeprefix) KDE 4.X uses ~/.kde4.

Settings are not migrated by default. If you want to attempt to migrate your settings you should copy your old configuration directory to the new location before logging in. For example:

Code Listing 3.6: Copying the configuration directory

$ cp -r ~/.kde ~/.kde4

If this is successful, then your settings should all be migrated. If not, it is possible to log out and remove the new configuration directory to start with a clean configuration directory.

Important: Moving backwards in version, from 4.X to 3.5, is not supported.

4.  Hints and Troubleshooting

Plasmoids

Plasmoids are new plasma tools which can enhance your desktop experience. Many plasmoids are available in the kde-misc/ category. If you find out that your favorite plasmoid is missing, file a bug and somebody might create it for you. If you've got to have them all, there is a set called @plasmoids which contains all plasmoids currently available.

Note: Many plasmoids are in the kde overlay.

Plasma Themes

The ebuild that contains various plasma themes is called x11-themes/plasma-themes. The procedure for requesting additional themes is the same as that for plasmoids.

Make GTK applications look like Qt 4 ones

The ebuild that should be used if you want your GTK applications to use the same theme as your Qt applications is called x11-themes/gtk-engines-qtcurve. You must also install x11-themes/qtcurve-qt4 for this to work with Qt 4/KDE 4 applications. In order to get configuration options in System Settings->Appearance->GTK Styles and Fonts, you have to install kde-misc/kcm_gtk.

Akonadi complains about the MySQL config

Start by checking the permissions in /usr/share/config and /usr/share/kde4. If they're 700, you need to update them to 755 recursively.

Code Listing 4.1: Updating /usr/share/config permissions

# chmod -R 755 /usr/share/{config,kde4}

If that doesn't solve the error, you need to open the akonadi configuration and change the default mysql config. If you don't have the tray running, start akonaditray, select "Akonadi Server Configuration", activate "Use internal MySQL server" and then press the test button. If you want to use the mysql server and not the embedded executable, you'll need to ensure that mysql is running.

Make KDE start on boot

There are two ways to make KDE start on boot. The easiest way is by using the KDM, which is available at kde-base/kdm. First we edit the Xorg Configuration file, so that DISPLAYMANAGER is set to "kdm":

Code Listing 4.2: Editing /etc/conf.d/xdm

# What display manager do you use ?  [ xdm | gdm | kdm | kdm-4.3 | gpe | entran$
# NOTE: If this is set in /etc/rc.conf, that setting will override this one.
#
# KDE-specific note:
# - If you are using kdeprefix go with "kdm-4.Y", e.g. "kdm-4.3".
#     You can find possible versions by looking at the directories in /usr/kde/.
# - Else, if you are using KDE 3 enter "kdm-3.5"
# - Else, if you are using KDE 4 enter "kdm" without a version
DISPLAYMANAGER="kdm"

Next step is to add xdm to default runlevel:

Code Listing 4.3: Adding xdm to the default runlevel

# rc-update add xdm default

Fonts suggestions

If you click to view the menu and notice that there is nothing legible, you need to install some fonts. Some common choices are media-fonts/corefonts, media-fonts/ttf-bitstream-vera and media-fonts/dejavu.

KDM fails to start

Start by checking the permissions in /usr/share/config. If they're 700, you need to update them to 755. Check previous section. If that doesn't solve the error, check the following notice in the kdm ebuild:

Code Listing 4.4: kdm notice

If when you restart xdm, kdm fails to start with a message like "gentoo kdm[2116]: X
server startup timeout, terminating" in /var/log/messages, uncomment the ServerTimeout
line in "grep kdmrc /var/db/pkg/kde-base/kdm-4.3.1/CONTENTS | cut -f2 -d " ""
and be sure to increase the timeout - 60 should work

Also be sure that the following services are started:

Code Listing 4.5: checking and starting services

# /etc/init.d/dbus status
# /etc/init.d/hald status
# /etc/init.d/consolekit status

If not, enable them by replacing status with start, and use the command rc-update add dbus default for every one of them to add them to default runlevel.

Finally, KDM could fail due to errors in /etc/X11/xorg.conf. Take a look in your logs: /var/log/Xorg.0.log and /var/log/kdm.log and fix xorg.conf accordingly. For additional help you can find us in IRC (#gentoo-kde at Freenode).

The battery applet or solid notifications don't show the relevant info

So that the battery applet or other solid notifications can show the relevant info, you need dbus and hald running.

Code Listing 4.6: checking and starting dbus and hald

# /etc/init.d/dbus status
# /etc/init.d/hald status
# /etc/init.d/dbus start
# /etc/init.d/hald start

Desktop profile and subprofiles

Desktop profile has been split to KDE and GNOME subprofiles. This means that KDE and GNOME specific USE flags have been stripped from the basic desktop profile and have been migrated to the subprofiles. Choosing a subprofile doesn't restrict you to use only the equivalent DE.



Print

Updated September 8, 2010

Summary: This guide demonstrates how to setup KDE SC using the ebuilds in the tree. Some tools from the KDE team's git overlay (kde) may be used.

Theo Chatzimichos
Author

Tomas Chvatal
Author

Jorge Manuel B. S. Vicetto
Author

Marcus D. Hanwell
Author

Tobias Heinlein
Editor

Joshua Saddler
Editor

Donate to support our development efforts.

Copyright 2001-2010 Gentoo Foundation, Inc. Questions, Comments? Contact us.