Building Plasma 5

KDE Plasma 5 is a collection of packages based on top of KDE Frameworks 5 and QML. They implement the KDE Display Environment (Plasma 5).

This package is known to build and work properly using an LFS-8.2 platform.

The instructions below build all of the Plasma 5 packages in one step by using a bash script.

Package Information

Plasma 5 Dependencies


GConf-3.2.6, GTK+-2.24.32, GTK+-3.22.30, KDE Frameworks-5.46.0, libpwquality-1.4.0, libxkbcommon-0.8.0, Mesa-18.1.1 built with Wayland-1.15.0, NetworkManager-1.10.8, PulseAudio-11.1, Python-2.7.15, qca-2.1.3, taglib-1.11.1, and xcb-util-cursor-0.1.3



GLU-9.0.0, IBus-1.5.18, Xorg Synaptics Driver-1.9.1, appstream-qt, KDevPlatform, libgps, libhybris, libraw1394, mockcpp, packagekit-qt, Qalculate, Qapt, SCIM, and socat (for pam_kwallet)

User Notes:

Downloading KDE Plasma5

The easiest way to get the KDE Plasma5 packages is to use a single wget to fetch them all at once:

wget -r -nH -nd -A '*.xz' -np $url

The options used here are:
  -r            recurse through child directories
  -nH           disable generation of host-prefixed directories
  -nd           do not create a hierarchy of directories
  -A '*.xz'     just get the *.xz files
  -np           don't get parent directories

Setting Package Order

The order of building files is important due to internal dependencies. Create the list of files in the proper order as follows:

cat > plasma-5.12.5.md5 << "EOF"
15e8b3abd34c7bed89247dcd89677da9  kde-cli-tools-5.12.5.tar.xz
7a6426a12788a1dc5fceb3ed0cf15818  kdecoration-5.12.5.tar.xz
1e3b3aa0026bf51121fa36f4380db6e5  libkscreen-5.12.5.tar.xz
2ffb11f91a451f90c034b5b657d38563  libksysguard-5.12.5.tar.xz
45cc26a47b5c742e93ba17e59d72d91a  breeze-5.12.5.tar.xz
4df4338cb8781e068e8b53987430cbda  breeze-gtk-5.12.5.tar.xz
30afafc98d6d3eecec15c1bad3ce0362  kscreenlocker-5.12.5.tar.xz
7622748eafe631e46574e44ba53bdaea  oxygen-5.12.5.tar.xz
5d0f3d5844ac31f2665ed0d5966d7751  kinfocenter-5.12.5.tar.xz
25bfe4cb9bbb782c938f92963ca1cd59  ksysguard-5.12.5.tar.xz
39cc7321fe28c2b4a76426da8a830d7c  kwin-5.12.5.tar.xz
08b5ebd84ee25d2306d30e1afe33f924  systemsettings-5.12.5.tar.xz
28906f048a968798f7311c1068aebb8b  plasma-workspace-5.12.5.tar.xz
60e92f4d444cba7e31041bf9c426d1aa  bluedevil-5.12.5.tar.xz
26706a36cb19c270281a0b69f8ab2609  kde-gtk-config-5.12.5.tar.xz
af8bda38832760df6bc0f07aa784f8f3  khotkeys-5.12.5.tar.xz
450833cf1ccd244c40102cd249e73d2b  kmenuedit-5.12.5.tar.xz
bdd7f9036220e39f23b1c57cb373174d  kscreen-5.12.5.tar.xz
667a9ef9a5f5fa4664e337d405cdfdb6  kwallet-pam-5.12.5.tar.xz
dffa9e29a181d6d70bcf20a5d9de0781  kwayland-integration-5.12.5.tar.xz
bc51d2068b1f442214059059761db068  kwrited-5.12.5.tar.xz
a6297963718e9315e72e1711e4f71e5c  milou-5.12.5.tar.xz
2f52d77ade3582ce05bc58c4d2ea2677  plasma-nm-5.12.5.tar.xz
0104e49c0e6332fdec3a61ddc9732c44  plasma-pa-5.12.5.tar.xz
30c03aeab0d69d87d08a5b1e57468f8c  plasma-workspace-wallpapers-5.12.5.tar.xz
b42ed1b4dfbc7f594529b12b4659a8e1  polkit-kde-agent-1-5.12.5.tar.xz
5546090caa4cf11656091ae229351551  powerdevil-5.12.5.tar.xz
bfcf9e48662c34d732b5f498b4627819  plasma-desktop-5.12.5.tar.xz
d16a91ea15fc12e7c18d420370ad0bd6  kdeplasma-addons-5.12.5.tar.xz
0ce29fe24ed752a36ce7fb6ff1be9fb1  kgamma5-5.12.5.tar.xz
805ba1b34c292e43f7791796d552a48c  ksshaskpass-5.12.5.tar.xz
#e7de5fcb703e47edc4f3fa5c9094dd9a  plasma-sdk-5.12.5.tar.xz
ba33b3187ddee122be32ffe0445564fb  sddm-kcm-5.12.5.tar.xz
f4268471d391b2fb7f51818b7b96c9f6  user-manager-5.12.5.tar.xz
8ae2ca25329d2126311e552fc24bff5c  discover-
#9101bdf4a6664dddc0e15b8fda4681e9  discover-5.12.5.tar.xz
#420c6369da5761fcee359cce8693badd  breeze-grub-5.12.5.tar.xz
#dbba7538a93056a57f52ecfe31eaf8cb  breeze-plymouth-5.12.5.tar.xz
d28812344e8e0f47b1121f56d3e13750  kactivitymanagerd-5.12.5.tar.xz
df9ade96432e4f5eb968e12ed7a7a72c  plasma-integration-5.12.5.tar.xz
ed8dbcc85b1a1f74dc04b2be5e64b36a  plasma-tests-5.12.5.tar.xz
e1a1a785e1f6c4a64af95e4989a07bea  plymouth-kcm-5.12.5.tar.xz
f9081bb509a565f3d11f28cd6b0a0914  xdg-desktop-portal-kde-5.12.5.tar.xz
08c841d2ea5b29ec4ffca146deeac75a  drkonqi-5.12.5.tar.xz
550e6df7522a10e5262136a54b88a254  plasma-vault-5.12.5.tar.xz


The breeze-grub, breeze-plymouth, and plymouth-kcm packages above are all for customized support of Plymouth which is designed to be run within an initial ram disk during boot (see the section called “About initramfs”). The plasma-sdk package is optional and used for software development.

Installation of Plasma5



When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the Sudo-1.8.23 package.

  3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"

export -f as_root

First, start a subshell that will exit on error:

bash -e

Install all of the packages by running the following commands:

while read -r line; do

    # Get the file name, ignoring comments and blank lines
    if $(echo $line | grep -E -q '^ *$|^#' ); then continue; fi
    file=$(echo $line | cut -d" " -f2)

    pkg=$(echo $file|sed 's|^.*/||')          # Remove directory
    packagedir=$(echo $pkg|sed 's|\.tar.*||') # Package directory

    tar -xf $file
    pushd $packagedir

       mkdir build
       cd    build

             -DCMAKE_BUILD_TYPE=Release         \
             -DBUILD_TESTING=OFF                \
             -Wno-dev ..  &&

        as_root make install

    as_root rm -rf $packagedir
    as_root /sbin/ldconfig

done < plasma-5.12.5.md5


cd $KF5_PREFIX/share/plasma/plasmoids

for j in $(find -name \*.js); do
  as_root ln -sfv ../code/$(basename $j) $(dirname $j)/../ui/

Command Explanations

ln -sfv ../code/$(basename $j) $(dirname $j)/../ui/: Create symbolic links so qml files can find needed javascript modules.

Configuring Plasma

Linux PAM Configuration

If you built Plasma with the recommended Linux PAM support, create necessary configuration files by running the following commands as the root user:

cat >> /etc/pam.d/kde << "EOF" 
# Begin /etc/pam.d/kde

auth     requisite
auth     required

auth     required uid >= 1000 quiet
auth     include        system-auth

account  include        system-account
password include        system-password
session  include        system-session

# End /etc/pam.d/kde

cat > /etc/pam.d/kde-np << "EOF" 
# Begin /etc/pam.d/kde-np

auth     requisite
auth     required

auth     required uid >= 1000 quiet
auth     required

account  include        system-account
password include        system-password
session  include        system-session

# End /etc/pam.d/kde-np

cat > /etc/pam.d/kscreensaver << "EOF"
# Begin /etc/pam.d/kscreensaver

auth    include system-auth
account include system-account

# End /etc/pam.d/kscreensaver

Starting Plasma5

You can start Plasma5 from a TTY, using xinit-1.4.0.

To start Plasma 5 using xinit-1.4.0, run the following commands:

cat > ~/.xinitrc << "EOF"
dbus-launch --exit-with-session $KF5_PREFIX/bin/startkde


The X session starts on the first unused virtual terminal, normally vt7. You can switch to another vtn simultaneously pressing the keys Ctrl-Alt-Fn (n=1, 2, ...). To switch back to the X session, normally started at vt7, use Ctrl-Alt-F7. The vt where the command startx was executed will display many messages, including X starting messages, applications automatically started with the session, and eventually, some warning and error messages. You may prefer to redirect those messages to a log file, which not only will keep the initial vt uncluttered, but can also be used for debugging purposes. This can be done starting X with:

startx &> ~/x-session-errors

When shutting down or rebooting, the shutdown messages appear on the vt where X was running. If you wish to see those messages, simultaneously press keys Alt-F7 (assuming that X was running on vt7).

If you intend to start Plasma using a display manager such as lightdm-1.24.0, there will be two entries for Plasma, one for use with Xorg, and another for Wayland. Modify the Xorg entry with the following command, as the root user, so that you can differentiate between the two:

sed '/^Name=/s/Plasma/Plasma on Xorg/' -i /usr/share/xsessions/plasma.desktop


Installed Programs: There are too many plasma programs (50 in /opt/kf5/bin) to list separately here.
Installed Libraries: There are too many plasma libraries (39 in /opt/kf5/lib) to list separately here.
Installed Directories: There are too many plasma directories (over 1000 in /opt/kf5) to list separately here.

Last updated on 2015-09-24 16:44:04 -0500