Guidelines and HOWTOs/Build from source/Install the dependencies

From KDE Community Wiki

In the following we give the dependencies to install. However it might change and this page might be quickly outdated.

Note

If some packages fail to install, you can try removing the ones that don't work from the list.


Reading the CMakeLists.txt of the packages you want to install should help you finding what you really need to install. Or read the error logs (see below).

If you need help, see https://community.kde.org/Get_Involved#Getting_in_touch


Enable the source repositories

Some operating systems also require that you enable on the source repositories before you can install build dependencies. Do that now, if necessary:


If you don't see your distro in the above list, then there's nothing you need to do here and you can safely move on.


All dependencies

KDE neon, Debian, Ubuntu, Kubuntu

$ sudo apt install autoconf baloo-kf5-dev bison breeze-dev build-essential bzr cmake cmake-data debhelper dh-apparmor doxygen extra-cmake-modules flex fontforge gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 git gperf icu-devtools kded5-dev kgendesignerplugin kinit-dev kirigami2-dev kross-dev kscreenlocker-dev kwin-dev libaccounts-glib-dev libappstreamqt-dev libapr1 libaprutil1 libarchive-dev libasound2-dev libattr1-dev libboost-dev libbz2-dev libcanberra-dev libcap-dev libclang-3.9-dev libclang-dev libcln-dev libcups2-dev libcurl4-gnutls-dev libegl1-mesa-dev libepoxy-dev libexiv2-dev libfakekey-dev libfontconfig1-dev libfreetype6-dev libgbm-dev libgconf2-dev libgcrypt20-dev libgif-dev libglib2.0-dev libgmp-dev libgmpxx4ldbl libgpgme11-dev libgps-dev libgrantlee5-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk-3-dev libhunspell-dev libibus-1.0-dev libicu-dev libjpeg8-dev libjpeg-dev libjpeg-turbo8-dev libjson-perl libkaccounts-dev libkdecorations2-dev libkeduvocdocument-dev libkf5activities-dev libkf5activitiesstats-dev libkf5akonadicalendar-dev libkf5akonadicontact-dev libkf5akonadi-dev libkf5akonadimime-dev libkf5akonadinotes-dev libkf5akonadisearch-dev libkf5alarmcalendar-dev libkf5archive-dev libkf5attica-dev libkf5auth-dev libkf5baloowidgets-dev libkf5blog-dev libkf5bluezqt-dev libkf5bookmarks-dev libkf5calendarcore-dev libkf5calendarsupport-dev libkf5calendarutils-dev libkf5cddb-dev libkf5codecs-dev libkf5compactdisc-dev libkf5completion-dev libkf5config-dev libkf5configwidgets-dev libkf5contacteditor-dev libkf5contacts-dev libkf5coreaddons-dev libkf5crash-dev libkf5dbusaddons-dev libkf5declarative-dev libkf5dnssd-dev libkf5doctools-dev libkf5emoticons-dev libkf5eventviews-dev libkf5filemetadata-dev libkf5followupreminder-dev libkf5globalaccel-dev libkf5grantleetheme-dev libkf5gravatar-dev libkf5guiaddons-dev libkf5holidays-dev libkf5i18n-dev libkf5iconthemes-dev libkf5identitymanagement-dev libkf5idletime-dev libkf5imap-dev libkf5incidenceeditor-dev libkf5itemmodels-dev libkf5itemviews-dev libkf5jobwidgets-dev libkf5jsembed-dev libkf5kaddressbookgrantlee-dev libkf5kaddressbookimportexport-dev libkf5kcmutils-dev libkf5kdcraw-dev libkf5kdegames-dev libkf5kdelibs4support-dev libkf5kdepimdbusinterfaces-dev libkf5kexiv2-dev libkf5kgeomap-dev libkf5khtml-dev libkf5kio-dev libkf5kipi-dev libkf5kjs-dev libkf5kmahjongglib-dev libkf5konq-dev libkf5kontactinterface-dev libkf5ksieve-dev libkf5ldap-dev libkf5libkdepim-dev libkf5libkleo-dev libkf5mailcommon-dev libkf5mailimporter-dev libkf5mailtransport-dev libkf5mbox-dev libkf5mediaplayer-dev libkf5mediawiki-dev libkf5messagecomposer-dev libkf5messagecore-dev libkf5messagelist-dev libkf5messageviewer-dev libkf5mime-dev libkf5mimetreeparser-dev libkf5networkmanagerqt-dev libkf5newstuff-dev libkf5notifications-dev libkf5notifyconfig-dev libkf5package-dev libkf5parts-dev libkf5people-dev libkf5pimcommon-dev libkf5pimtextedit-dev libkf5plasma-dev libkf5plotting-dev libkf5prison-dev libkf5pty-dev libkf5purpose-dev libkf5qqc2desktopstyle-dev libkf5runner-dev libkf5sane-dev libkf5screen-dev libkf5sendlater-dev libkf5service-dev libkf5solid-dev libkf5sonnet-dev libkf5style-dev libkf5su-dev libkf5syndication-dev libkf5syntaxhighlighting-dev libkf5sysguard-dev libkf5templateparser-dev libkf5texteditor-dev libkf5textwidgets-dev libkf5threadweaver-dev libkf5tnef-dev libkf5unitconversion-dev libkf5vkontakte-dev libkf5wallet-dev libkf5wayland-dev libkf5webengineviewer-dev libkf5webkit-dev libkf5widgetsaddons-dev libkf5windowsystem-dev libkf5xmlgui-dev libkf5xmlrpcclient-dev libktorrent-dev liblcms2-dev liblmdb-dev libmlt-dev libmlt++-dev libnm-dev libnm-glib-dev libnm-util-dev libpackagekitqt5-dev libpam-dev libphonon4qt5-dev libphonon4qt5experimental-dev libpng-dev libpolkit-agent-1-dev libpolkit-backend-1-dev libpolkit-gobject-1-dev libpulse-dev libpwquality-dev libqalculate-dev libqca-qt5-2-dev libqimageblitz-dev libqrencode-dev libqt5sensors5 libqt5sensors5-dev libqt5svg5-dev libqt5texttospeech5-dev libqt5webkit5-dev libqt5x11extras5-dev libqt5xmlpatterns5-dev libqt5networkauth5-dev libraw1394-dev libscim-dev libserf-1-1 libsm-dev libssl-dev libsvn1 libtiff5-dev libudev-dev libusb-dev libvlccore-dev libvlc-dev libvncserver-dev libwww-perl libx11-dev libx11-xcb-dev libxapian-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor0 libxcb-cursor-dev libxcb-damage0-dev libxcb-dpms0 libxcb-dpms0-dev libxcb-ewmh2 libxcb-ewmh-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-record0-dev libxcb-render-util0-dev libxcb-res0 libxcb-res0-dev libxcb-screensaver0 libxcb-screensaver0-dev libxcb-shm0-dev libxcb-util0-dev libxcb-xf86dri0 libxcb-xf86dri0-dev libxcb-xinerama0 libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xtest0-dev libxcb-xv0 libxcb-xv0-dev libxcb-xvmc0 libxcb-xvmc0-dev libxcursor-dev libxft-dev libxi-dev libxkbfile-dev libxml2-dev libxml-parser-perl libxrender-dev libxslt1-dev libxslt-dev llvm llvm-3.9 modemmanager-dev modemmanager-qt-dev network-manager-dev openbox oxygen-icon-theme perl-modules pkg-config pkg-kde-tools plasma-workspace-dev po-debconf qml-module-qtquick* qt5-qmake qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qtdeclarative5-dev qtmultimedia5-dev qtquickcontrols2-5-dev qtscript5-dev qttools5-dev qtxmlpatterns5-dev-tools shared-mime-info subversion texinfo xauth xcb-proto xserver-xorg-dev xserver-xorg-input-evdev-dev xserver-xorg-input-libinput-dev xserver-xorg-input-synaptics-dev xsltproc xvfb

For the frameworks

Arch, Antergos, Manjaro

All the dependencies used for building frameworks can be installed by running:

$ sudo pacman -Sy --needed phonon-qt5 qt5-webkit qt5-script qt5-svg qt5-tools qt5-x11extras enchant jasper openexr libutempter docbook-xsl shared-mime-info giflib libxss upower udisks2 bzr git doxygen perl-json perl-libwww perl-xml-parser perl-io-socket-ssl akonadi xorg-server-devel libpwquality fontforge eigen libfakekey qca-qt5 xapian-core xsd gperf perl-yaml-syck intltool kdesdk qrencode libdmtx boost

Fedora

All the dependencies used for building frameworks can be installed by running:

$ sudo dnf install perl-IPC-Cmd perl-JSON-PP perl-YAML-Syck qt5-devel qt5-qtquickcontrols2-devel polkit-devel gperf libxslt-devel libxml2-devel kf5-kconfigwidgets-devel libXrender-devel qrencode-devel xcb*-devel flex systemd-devel giflib-devel libjpeg-turbo-devel NetworkManager-libnm-devel ModemManager-devel libattr-devel openssl-devel libSM-devel wayland-devel lmdb-devel libaccounts-qt5-devel libaccounts-glib-devel signon-devel


openSUSE

openSUSE Leap 15 (Argon)

Updated 24 June 2018 (likely incomplete)

$ sudo zypper si -d libqt5-qtbase
$ sudo zypper in libbz2-devel libxslt-devel libxml2-devel shared-mime-info oxygen-icon-theme giflib-devel vlc-devel doxygen gstreamer-devel gstreamer-plugins-base-devel docbook-xml-slides docbook-xsl-stylesheets xcb-util-keysyms-devel perl-JSON boost-devel libxcb-devel libXrender-devel xcb-util-wm-devel xcb-util-devel xcb-util-image-devel gettext-tools libepoxy-devel
$ sudo zypper in gtk3-devel
$ sudo zypper in grantlee5-devel kactivities5-devel plasma-framework-devel plasma5-addons-devel plasma5-workspace-devel libQt5Concurrent-devel libQt5DBus-devel libQt5PrintSupport-devel xcb-util-cursor-devel libqt5-qtx11extras-devel xcb-proto-devel git-core

openSUSE 42.1

Install these packages (including the recommended packages):

$ sudo zypper install patterns-openSUSE-devel_kde patterns-openSUSE-devel_kde_frameworks git-core bzr ninja \
gettext-tools libqt5-qttools libgypsy0 libqt5-creator libqt5-linguist libqt5-qtbase-common-devel libqt5-qtbase-devel libqt5-qtbase-examples libqt5-qtdeclarative-devel libqt5-qtdeclarative-examples libqt5-qtdeclarative-tools libqt5-qtdoc libqt5-qtgraphicaleffects libqt5-qtimageformats libqt5-qtimageformats-devel libqt5-qtmultimedia-devel libqt5-qtmultimedia-examples libqt5-qtquick1-devel libqt5-qtquickcontrols libqt5-qtscript-devel libqt5-qtscript-examples libqt5-qtsvg-devel libqt5-qttools-devel libqt5-qtx11extras-devel libqt5-qtxmlpatterns-devel libqt5-qtxmlpatterns-examples libQt5CLucene5 libQt5Concurrent-devel libQt5Concurrent5 libQt5Core-devel libQt5Core5 libQt5DBus-devel libQt5DBus5 libQt5Declarative5 libQt5Designer5 libQt5DesignerComponents5 libQt5Gui-devel libQt5Gui5 libQt5Help5 libQt5Multimedia5 libQt5Network-devel libQt5Network5 libQt5OpenGL-devel libQt5OpenGL5 libQt5Positioning5 libQt5PrintSupport-devel libQt5PrintSupport5 libQt5Script5 libQt5Sensors5 libQt5Sql-devel libQt5Sql5 libQt5Sql5-mysql libQt5Sql5-postgresql libQt5Sql5-sqlite libQt5Sql5-unixODBC libQt5Svg5 libQt5Test-devel libQt5Test5 libQt5WebKit5 libQt5WebKitWidgets5 libQt5Widgets-devel libQt5Widgets5 libQt5X11Extras5 libQt5Xml-devel libQt5Xml5 libQt5XmlPatterns5 libQtQuick5 libQt5WebKitWidgets-devel libqt5-qtbase-private-headers-devel \
xcb-util-keysyms-devel docbook-xsl-stylesheets doxygen polkit-devel libepoxy-devel boost-devel libXcursor-devel libSM-devel giflib-devel libaccounts-qt5-devel gtk3-devel libpng16-devel fltk-devel libopenssl-devel libattr-devel ModemManager-devel NetworkManager-devel wayland-devel lmdb-devel xcb-proto-devel xcb-util-image-devel xcb-util-cursor-devel xcb-util-devel gtk2-devel libqca-qt5-devel libpwquality-devel libical-devel PackageKit-Qt5-devel pam-devel \
bison flex libqt5-qttools-doc
  • Failing modules (of more than 200 modules)
    • phonon-vlc, phonon-gstreamer, plasma-pa (PulseAudio missing), kdevplatform, plasma-desktop, kaccounts-integration, kaccounts-mobile, gwenview, kdevelop, libksane, skanlite, ... (see below for solutions)

openSuSE Tumbleweed

This more complete list (which probably works for OpenSuSE 42.1 as well) allows to compile everything that kdesrc-build's default setup (kf5-qt5-build-include) compiles. Note that it doesn't contain Qt or Qt-based libs, you need that on top, or to compile your own Qt (and then include custom-qt5-libs-build-include in kdesrc-buildrc).

$ sudo zypper install patterns-kde-devel_kde_frameworks patterns-kde-devel_qt5 make cmake extra-cmake-modules ccache git bzr antlr antlr-java antlr-devel astyle autoconf flac gettext-tools intltool libMagick++-devel libplotter2 libtool pstoedit subversion-devel subversion-tools xscreensaver-data libxslt-devel docbook-xsl-stylesheets libpoppler-devel aspell-devel enchant-devel libidn-devel polkit-devel update-desktop-files atk-devel bluez-devel fdupes gdk-pixbuf-devel gtk3-devel libcanberra-devel libexiv2-devel libpulse-devel gtk-doc libsmbclient-devel libssh-devel libusb-1_0-devel libusb-compat-devel libxine-devel libxklavier16 libxklavier-devel xwininfo NetworkManager-devel ModemManager-devel libssh2-devel openslp-devel pango-devel xz-devel libgssglue-devel libjasper-devel libudev-devel utempter-devel libbotan-devel libmysqlclient-devel postgresql-devel libmysqld-devel cgdb gstreamer-plugins-base-devel gstreamer-devel libsamplerate-devel audiofile-devel flac-devel libvorbis-devel fftw3-devel libmusicbrainz-devel cdparanoia-devel flex parted-devel libopus-devel giflib-devel pciutils-devel pam-devel boost-devel libv4l-devel cyrus-sasl-devel libgpgme-devel libical-devel sane-backends-devel libgphoto2-devel doxygen makeinfo LibVNCServer-devel speex-devel libotr-devel libmms-devel libsndfile-devel mpfr-devel libzeitgeist-devel gperf libcap-devel libarchive-devel telepathy-logger-devel libpwquality-devel opencv-devel glew-devel libxapian-devel libblkid-devel libatasmart-devel libiodbc-devel xcb-util-wm-devel xcb-util-renderutil-devel xcb-util-keysyms-devel xcb-util-image-devel xcb-util-cursor-devel libxkbcommon-devel vlc-devel libicu-devel icu-data libkolabxml-devel xsd libffi-devel-gcc5 perl-Tie-IxHash perl-JSON perl-Text-CSV perl-YAML-Syck hunspell-devel ffmpeg-devel libacl-devel libnl-devel liboauth-devel libepub-devel libicecream-devel docbook2X liblcms2-devel libeigen2-devel eigen3-devel graphviz-devel liboyranos-devel libraw-devel xf86-input-wacom-devel libwacom-devel xf86-input-synaptics-devel xorg-x11-server-sdk libdiscid-devel libmlt++-devel libdmtx-devel qrencode-devel libfunambol-devel libmtp-devel at-spi2-core-devel openal-soft-devel python-sip-devel libXcm-devel libspeechd-devel libraw-devel ModemManager-devel farstream-devel tesseract-ocr-devel mtdev-devel fontforge-devel cups-devel libepoxy-devel openconnect-devel lmdb-devel libpgf-devel llvm-devel llvm-clang-devel binutils-devel libdwarf-devel libelf-devel plymouth-devel libfakekey-devel python-GitPython php php-curl telepathy-mission-control-devel libaccounts-glib-devel

For Plasma

  • Arch/Antergos/Manjaro: sudo pacman -S plasma-desktop plasma-workspace kwin
  • Fedora: sudo dnf builddep plasma-desktop plasma-workspace kwin
  • KDE neon/Kubuntu/Ubuntu/Debian sudo apt build-dep plasma-desktop plasma-workspace kwin
  • openSUSE Leap & Tumbleweed: sudo zypper si -d plasma-desktop plasma-workspace kwin

Any other dependencies can be figured out and installed as you continue building the modules one by one.

Quick fixes for package manager errors

The above lists might not always be working out of the box on your specific distribution or might be out of date for individual packages. In many cases removing single packages from the lists above still allows you to build many KDE frameworks and applications.

In case it is a package added by a regex, you can exclude the specific package by a workaround using sed. Let us assume for an example that we want to install "libkf5.*-dev" on deb-based systems but have uninstallable packages libkf5example1-dev, libkf5example2-dev. Then we install all "libkf5.*-dev" packages excluding libkf5example1-dev and libkf5example2-dev through:

$ sudo apt install $(apt-cache search -n "libkf5.*-dev" | sed 's/ - .*//' | sed '/libkf5example1-dev/d' | sed '/libkf5example2-dev/d')