KDE Pre-installation Configuration

Installing in /usr

One option is to put KDE into the /usr hierarchy. This creates a simpler setup but makes it more difficult to try multiple versions of KDE.

export KDE4_PREFIX=/usr

Installing in /opt

A method of building multiple versions installs KDE in the /opt hierarchy:

export KDE4_PREFIX=/opt/kde4

If you are not installing KDE in /usr, you will need to make some additional configuration changes. Best practice is to add those to your system or personal profile:

cat > /etc/profile.d/kde4.sh << "EOF"
# Begin /etc/profile.d/kde4.sh

KDE4_PREFIX=/opt/kde4
KDE4DIR=$KDE4_PREFIX
KDEDIR=$KDE4_PREFIX

pathappend $KDE4_PREFIX/bin             PATH
pathappend $KDE4_PREFIX/lib/pkgconfig   PKG_CONFIG_PATH
pathappend $KDE4_PREFIX/share/pkgconfig PKG_CONFIG_PATH
pathappend $KDE4_PREFIX/share           XDG_DATA_DIRS
pathappend /etc/kde4/xdg                XDG_CONFIG_DIRS

export KDE4_PREFIX KDE4DIR KDEDIR

# End /etc/profile.d/kde4.sh
EOF

Add to your /etc/ld.so.conf:

cat >> /etc/ld.so.conf << "EOF"
# Begin kde4 addition

/opt/kde4/lib

# End kde4 addition
EOF

Add to your /etc/man_db.conf:

cat >> /etc/man_db.conf << "EOF"
# Begin kde4 addition

MANDATORY_MANPATH /opt/kde4/man

# End kde4 addition
EOF

Several KDE packages install files into D-Bus and polkit directories. When installing KDE in a location other than /usr, D-Bus and polkit need to find these files. The easiest way to achieve this is to create the following symlinks (as the root user):

install -d /opt/kde4/share &&
ln -svf /usr/share/dbus-1 /opt/kde4/share &&
ln -svf /usr/share/polkit-1 /opt/kde4/share

D-Bus also needs to find the configuration files for the system-wide bus, which, if you follow the books instructions, are installed in /etc/kde4/dbus-1/system.d. Fix this by issuing the following (as root):

cat > /etc/dbus-1/system-local.conf << "EOF"
<!DOCTYPE busconfig PUBLIC
 "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>

  <includedir>/etc/kde4/dbus-1/system.d</includedir>

</busconfig>
EOF
[Tip]

Tip

Sometimes, the installation paths are coded into installed files. This is the reason why /opt/kde4 is used as installation prefix instead of /opt/kde-4.8.3. After installing KDE4, you may rename the directory and create a symlink:

mv /opt/kde{4,-4.8.3} &&
ln -svf kde-4.8.3 /opt/kde4

Later on, you may want to install other versions of KDE. To do that, just remove the symlink and use /opt/kde4 as the prefix again (KDE must not be started). Which version of KDE you use depends only on where the symlink points to. No other reconfiguration will be needed.

Last updated on 2012-04-15 17:19:58 +0000