Skip to content

Instantly share code, notes, and snippets.

@4194304
Last active January 13, 2026 06:16
Show Gist options
  • Select an option

  • Save 4194304/4fc38a34ab4fbc8e2cb7addb05c00be0 to your computer and use it in GitHub Desktop.

Select an option

Save 4194304/4fc38a34ab4fbc8e2cb7addb05c00be0 to your computer and use it in GitHub Desktop.
How to install KDE2 on modern software and hardware

Introduction

KDE2 was released in the year 2000 and the last version was KDE 2.2.2 released in 2001.

It was released a long time ago, but thanks to the KDE Restoration Project there are sources that build on modern computers.

It's decently difficult, but if you have enough patience you can do it.

Basic prerequisites

This guide will be based on Arch Linux. If you're on another distribution like Debian, Fedora, or even Alpine, searching around should be enough to find identical packages.

To make things easier, I would recommend installing a window manager like Openbox or TWM so you can multitask.

Firstly, I would recommend having as clean of an install as possible, or if you're 100% confident that you have not installed KDE (like KDE6, Katana, Trinity, etc.), as it will ensure that it will likely work as intended. Otherwise you may run into errors and crashes with various KDE components.

Secondly, you should also install Xorg. This should be pretty obvious. I would also HIGHLY recommend installing cmake3 (it's an AUR package), and yay (so you can access the AUR), so configuration and package installation goes as smoothly as possible.

There will likely be packages that I don't have here that you will need. For the main list of packages: sudo pacman -S byacc git make automake autoconf xorg-iceauth xorg-xinit flex freeglut acl alsa-lib bzip2 freetype2 mesa libjpeg-turbo libtool libmng pcre pcre2 libtiff libxft libxml2 libxmu libxslt pkgconf

If you did not install cmake3, I would highly recommend installing it. That being said, normal cmake should work with this.

Fixing X11 fonts

After the installation, KDE2 might complain about fonts being missing. To fix this, run: xset +fp /usr/share/fonts/misc xset +fp /usr/share/fonts/100dpi xset +fp /usr/share/fonts/75dpi xset +fp /usr/share/fonts/Type1 xset fp rehash Run each consecutive command separately.

If xlsfonts | wc -l returns a count of over 1000 (assuming you have all of the xorg font packages), you should be good to go. If that still shows an extremely low number, try running those commands again as root.

Compiling

From this point, it will be cloning repositories, making a build directory, modifying CMakeLists.txt, compiling, fixing errors along the way, and eventually installing what we have built.

If any errors pop up that are not listed in this guide, I would highly recommend feeding ChatGPT the error you got so you don't get a headache. Also make a comment on this guide informing me of what the error was and I'll add a fix for it if I can reproduce it.

I would recommend making a folder for the repositories where they are cloned. For example, it might be a folder named kde2 in your home directory.

If you encounter missing library or package errors in the configuration process, the package should typically have the same name as what can be found on the repos. If it can't find it, run sudo pacman -Ss <package> or yay -Ss <package>, where is the name of what it wants.

Qt2

First, clone the repository: git clone https://invent.kde.org/sandsmark/qt2.

Once it is cloned, enter the directory. It should have the name qt2. From there, make a folder called build, enter the folder, and run cmake .. (or cmake3 .. if you installed cmake3, if you did not install modern cmake beforehand cmake3 will use the cmake name).

After that, edit CMakeLists.txt which is outside of the build folder. Near the top of the file (where other lines to set attributes are) on a blank line, add set(CMAKE_CXX_STANDARD 11).

From there, you should be able to compile by running make. From what I have seen, it compiles successfully without errors.

After making qt2, install it with sudo make install.

From this point onward, an EXTREMELY important thing to do is add export LD_LIBRARY_PATH=/usr/local/lib to ~/.bashrc, so /usr/local/lib is recognized on all new shells. If you do not want to open another shell (or if you're in the tty), simply run export LD_LIBRARY_PATH=/usr/local/lib.

KDELibs

First, clone the repository with git clone https://github.com/sandsmark/kde2-kdelibs.

Same as with Qt2, enter the folder, make a folder named build, run cmake .., and add set(CMAKE_CXX_STANDARD 11) to the CMakeLists.txt file outside of the folder.

From there run make as before.

Errors: Since the code is a bit outdated, it doesn't fully compile correctly. As such it may stop randomly. Here are some errors that I encountered and the fix for them:

artsc error (at 72%):

/home/user/sandsmark2/kde2-kdelibs/arts/artsc/artscbackend.cc:553:8: error: expected unqualified-id before user-defined string literal
  553 | extern "C"arts_stream_t arts_backend_record_stream(int, int, int, const char *)
      |        ^~~~~~~~~~~~~~~~
/home/user/sandsmark2/kde2-kdelibs/arts/artsc/artscbackend.cc:569:8: error: expected unqualified-id before user-defined string literal
  569 | extern "C"int arts_backend_read(arts_stream_t, void *, int)
      |        ^~~~~~

To fix it:

Go outside the build directory, navigate to arts/artsc/ and edit artscbackend.cc. Go to lines 553 and 569 and simply add a space between extern"C" and what follows it.

For example: extern "C"int -> extern "C" int.

After you have fixed the error, run make again and it should compile successfully. From there run sudo make install.

KDEBase

First, clone the repository with git clone https://github.com/sandsmark/kde2-kdebase.

Same as before, enter the folder, make a folder named build, run cmake .., and add set(CMAKE_CXX_STANDARD 11) to the CMakeLists.txt file outside of the folder.

From there run make.

Errors:

KSysGuard error (happened at around 85%):

/home/user/sandsmark2/kde2-kdebase/ksysguard/ksysguardd/Linux/ksysguardd.c: In function 'createServerSocket':
/home/user/sandsmark2/kde2-kdebase/ksysguard/ksysguardd/Linux/ksysguardd.c:343:29: error: passing argument 2 of 'bind' from incompatible pointer type [-Wincompatible-pointer-types]
  343 |         if (bind(newSocket, (struct sockaddr_in*) &sin, sizeof(sin)) < 0)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                             |
      |                             struct sockaddr_in *
In file included from /usr/include/netinet/in.h:23,
                 from /usr/include/netdb.h:27,
                 from /home/user/sandsmark2/kde2-kdebase/ksysguard/ksysguardd/Linux/ksysguardd.c:26:
/usr/include/sys/socket.h:112:49: note: expected 'const struct sockaddr *' but argument is of type 'struct sockaddr_in *'
  112 | extern int bind (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len)
      |                                                 ^
/home/user/sandsmark2/kde2-kdebase/ksysguard/ksysguardd/Linux/ksysguardd.c: In function 'handleSocketTraffic':
/home/user/sandsmark2/kde2-kdebase/ksysguard/ksysguardd/Linux/ksysguardd.c:435:60: error: passing argument 2 of 'accept' from incompatible pointer type [-Wincompatible-pointer-types]
  435 |                         if ((clientSocket = accept(socket, &addr, &addr_len)) < 0)
      |                                                            ^~~~~
      |                                                            |
      |                                                            struct sockaddr_in *
/usr/include/sys/socket.h:306:45: note: expected 'struct sockaddr * restrict' but argument is of type 'struct sockaddr_in *'
  306 | extern int accept (int __fd, __SOCKADDR_ARG __addr,
      |                                             ^

Fix for line 343: Change the contents of the line to: if (bind(newSocket, (struct sockaddr *) &sin, sizeof(sin)) < 0)

Fix for line 435: Change the contents of the line to: if ((clientSocket = accept(socket, (struct sockaddr *)&addr, &addr_len)) < 0)

It should successfully compile after you fix the errors, and like last time run sudo make install.

Post Installation

From here, make a file in your home directory named .xinitrc. If you have a display manager, disable it.

Edit ~/.xinitrc so it is as follows:

exec /usr/local/bin/startkde2

Once you do this, when you start X11 you should be greeted with the KDE2 setup wizard. If there is no panel and it's incredibly unstable (apps crashing), your install is likely contaminated with libraries from other KDE versions, so you will have to reinstall and redo this guide.

If it gives an error about missing libraries, make sure that export LD_LIBRARY_PATH=/usr/local/lib is in your .bashrc file. If Konsole is giving an error about missing fonts on startup, please refer back to the Fixing X11 Fonts section.

Extras

Most of these guides will be copied because compilation will go without any errors.

KDEToys

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdetoys. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt. After compiling, run sudo make install.

KDEUtils

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdeutils. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt. After compiling, run sudo make install.

KDEGames

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdegames. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt. After compiling, run sudo make install.

KDEStudio (incomplete)

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdeutils. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt.

Fixes for errors: Change line 191 in Components/studioui/action/saction.cpp to: qDebug("Cannot find action: %s", name);

Change line 341 in Components/studioui/action/saction.cpp to: if ( tdata == 0L ) qDebug("SAction:: cannot find action name: %s", name.latin1());

Change lines 181 and 182 in src/workspace/workspace.cpp to:

    qDebug("ERROR - or template file kde_workspace.tar.gz");

Change line 1304 in src/workspace/workspace.cpp to: if ( !(QDir().rename( dir, newDir )) ){ qDebug("cannot move project"); return; }

Change line 79 in src/studiocore/studioview.cpp to: qDebug("void StudioView::init()");

Change line 50 in src/PluginsManager/pluginmanager.cpp to: qDebug("delete manager");

Change line 1 in each file that ends with C inside the folder Plugins/RTClassParser/parser/ to: #include <stdbool.h>

Do a case sensitive replace in each file that ends with C inside the folder Plugins/RTClassParser/parser/: FALSE -> false TRUE -> true

Inside main.c, replace every instance of error(FATAL, "out of memory"); with error();

Inside get.c, add the following to the top of the file:

int fileGetc(void);
int fileUngetc(void);

To the top of vstring.c, add #include <ctype.h>.

After compiling, run sudo make install.

KDE2 Kio SFTP

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kio-sftp. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt. After compiling, run sudo make install.

KDE2 KDEMultimedia (incomplete)

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdemultimedia. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt.

Fixes for errors:

After compiling, run sudo make install.

KDE2 KDEArtwork

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdeartwork. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt. After compiling, run sudo make install.

KDE2 KDEGraphics

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdegraphics. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt.

Fixes for errors:

After compiling, run sudo make install.

KDE2 KDENetwork

Firstly, run git clone https://invent.kde.org/sandsmark/kde2-kdenetwork. Then cd into the folder, make a build directory (and cd into it), then run cmake .. and after that make to build. You do not have to specify C++11 in CMakeLists.txt. After compiling, run sudo make install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment