The K Desktop Environment

Next Previous Table of Contents

4. Installation instructions

These are the installation instructions for the 1.0 release of the KDE Desktop Environment. For later versions, please complement your reading with the READMEs and INSTALLs that come along with the package. Please read them carefully and try to help yourself out if anything goes wrong. If you need further assistance, consider joining the KDE mailing lists (see our web site instructions for joining the KDE mailing lists) or newsgroups.

4.1 To the would-be converts

So you have heard the rumours. Or you have seen the screenshots. And you are dying to get hold of KDE. But you know next to nothing about this whole "alternative OS" business. Don't worry! You only need to do some (well, maybe not some) reading, that's all!

KDE doesn't run on Windows 95/98/NT or OS/2 (yet). To run KDE, you need to have a Unix system. Please refer to On which platforms can I expect KDE to work? for more details.

Let's say you have decided to install Linux. You can either download it from the Internet, or buy a CD-ROM set that contains the distribution of your choice. You might find the following resources useful:

In order to run KDE on Linux, you need to set up X first. X is the de facto GUI on Unix systems. You might want to take a look at the following resources:

Finally, you are ready to commence the KDE installation. Please start reading from the next section. To get KDE, please see Where do I get KDE?. Last but not least, if you encounter any problems while installing KDE, please do not hesitate to make use of the KDE mailing lists and newsgroups. But do bear this in mind: no question is too silly to ask, but some are too silly to answer, especially when they are already answered in this FAQ.

Good luck and have fun!

4.2 Available package formats

The KDE team provides six different kinds of packages: source and binary RPMs, source and binary .tgz (.tar.gz) files, and source and binary Debian files. The first to be released are usually the source .tgz files, but other formats will appear soon after. Recently, source and binary .tar.bz2 files are also being made available. Please see How do I unzip tarballs with the 'bz2' extension? for more information. In addition, pkg packages for Solaris 2.6 and 7 have also appeared.

The installation process depends on which package format you choose. After installation, there are post-installation procedures that apply for all package formats. Note that if you are an inexperienced Unix user and have a RPM-based system you are probably best off choosing the binary RPM packages being provided by your distribution vendor. At least Caldera, Delix and S.u.S.E. will make binary RPMs available via their FTP servers.

If you need special configuration options (e.g. because you have shadow passwords and want to use the screen-savers), your best bet is to use the source packages and compile the KDE Desktop Environment yourself. Binary RPM packages for distributions which do not offer official KDE packages are made available via the contrib section of ftp.kde.org as soon as they are available.

Bill Mote has published a home page called "KDE 1.1 Installation via RPM". Go see it at http://home.fuse.net/bmote/kde.htm.

4.3 Prerequisites

For KDE 1.0, you need the Qt library version 1.33 or higher, while for KDE 1.1, you need version 1.42 or higher. Don't download Qt 2.0 or higher, though. You would also need the header files as well if you want to compile KDE yourself. They are all available at no cost from http://www.troll.no/dl. You also need the libgr which should be included in most distributions. Please also make sure that your local loopback device is setup correctly.

4.4 Description of the base packages

The base distribution currently consists of eleven packages. Some are required, while others are optional. Each package is available in each of the aforementioned package formats.

kdesupport (if needed) should be installed before everything else. The next (or first) package should be kdelibs. The other packages can be installed in any arbitrary order.

4.5 Installation instructions for the different package formats

Please don't forget to read the README and INSTALL files if they are available.

Installation of the Debian packages

The Debian packages install according to the upcoming FHS (file hierarchy standard).

To install the Debian package:

for each and every package you want to install.

Installation of the RPM packages

The RPM packages install into /opt/kde.

To install the binary RPM:

To create a binary RPM from the source RPM and install it, do the following:

Installation of the source .tar.gz files

The source .tgz package installs into /usr/local/kde by default. You can override this setting by using the "--prefix" option of the configure script.

Installation of the binary .tar.gz files

The binary .tar.gz package installs into /opt/kde.

4.6 Post-installation procedures

First of all, please make sure that you have added KDE's binary installation directory (e.g. /opt/kde/bin) to your PATH and KDE's library installation directory to your LD_LIBRARY_PATH (only necessary on systems that do not support rpath; on Linux ELF, it should work without). This environment variable may be called differently on some systems, e.g. it is called SHLIB_PATH on IRIX. Then set the environment variable KDEDIR to the base of your KDE tree, e.g. /opt/kde.

Please bear in mind that it is unwise to set LD_LIBRARY_PATH blindly. In the vast majority of cases it's unnecessary and can do more harm than good. There's a web page written by Dave Barr explaining the evils of LD_LIBRARY_PATH and it can be found at http://www.cis.ohio-state.edu/~barr/ldpath.html.

Even though you can use most of the KDE applications simply by calling them, you can only benefit fully from KDE's advanced features if you use the KDE window manager KWM and its helper programs.

In order to make it easy for you, we have provided a simple script called startkde which gets installed in $KDEDIR/bin and is therefore in your path.

Edit the file .xinitrc in your home directory (make a backup copy first!), remove everything that looks like calling a window manager, and insert startkde instead. Restart X. If you use kdm/xdm, you will have to edit the file .xsession instead of .xinitrc. And if there is no .xinitrc or .xsession in your home directory, simply create a new one with just one line containing "startkde" (without the quotes!). Note: some systems (notably Redhat Linux) uses .Xclients instead.

This should present you with a new shining KDE desktop. You can now start to explore the wonderful world of KDE. In case you want to read some documentation first, there is a highly recommended quickstart guide available. Furthermore, every application has an online help that is available via the help menu.

4.7 Micro-HOWTO: Compiling KDE 1.1 on SGI Irix 6.x

Chris Sterritt posted the following (edited for layout) to comp.windows.x.kde.

  1. Install Qt 1.42 or higher.
  2. I am installing KDE as me (not root) so I have a KDEDIR environmental var which is set to something other than /usr/local/ or whatever is the default. So I'll mention it below, but you may not have to. Also, SGI has a 'jpeg' and a 'png' library, but they're out of date or otherwise wrong. So you'll have to track down the libpng and libz sources (jpeg comes in kdesupport); I found them as source RPMs in one of the RedHat FTP mirrors.
  3. Get egcs 1.1.1 or later and compile it with '-fsquangle' support on. This is because SGI's assembler can't handle the huge object names produced by normal g++, and gas doesn't evidently work yet for SGIs. You'll have to build gcc's libraries using this binary as well. Make sure your PATH gets this compiler only (if you have another gcc installed somewhere). When I do a 'g++ -v' I get:
    gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
    
  4. Do a
    setenv LDFLAGS " "
    
    because the 'configure' scripts insist on trying 'g++ -s' when compiling a test program, which always fails on the SGIs.
  5. Unpack 'kdesupport' and enter its directory. Run its configure with "--prefix" if you need to:
    ./configure --prefix=$KDEDIR
    
  6. Run the script (which I'll include below) as follows:
    find . -name Makefile -exec ../FixMakesSq {} \;
    
    This fixes all the compile lines so that:
    • CXXFLAGS has '-fsquangle'.
    • all the 'replicated' libraries (jpeg and png) are replaced with full paths so they won't be linked with the SGI ones.
    Here's the FixMakesSq script:

    #!/bin/perl -ni.bak
    if (/cflags\s*=(.*)$/i)
    {
            print "CFLAGS =  -fsquangle $1\n";
    }
    elsif (/cxxflags\s*=(.*)$/i)
    {
            print "CXXFLAGS =  -fsquangle $1\n";
    }
    elsif ((/-lpng/) || (/-ljpeg/))
    {
            if (/^(.*)-lpng(.*)$/)
            {
                    $b4 = $1;
                    $af = $2;
                    print "$b4 /path/to/KDE/libs/libpng.a $af\n";
            }
            if (/^(.*)-ljpeg(.*)$/)
            {
                    $b4 = $1;
                    $af = $2;
                    print "$b4 /path/to/KDE/libs/libjpeg.a $af\n";
            }
    }
    else
    {
            print;
    }
    

  7. Do:
    make
    make install
    
  8. Go to the 'libz' source directory, do:
    ./configure --prefix=$KDEDIR
    make
    make install
    
  9. Go to the 'libpng' source directory, do:
    ./configure --prefix=$KDEDIR
    make
    make install
    
  10. Unpack 'kdelibs' and enter its directory. Note the '--enable-new-stuff' argument to ./configure:
    ./configure --prefix=$KDEDIR --enable-new-stuff
    find . -name Makefile -exec ../FixMakesSq {} \;
    
  11. Find 'kprocctrl.cpp', and fix the Makefile in that directory. Add '-D_LANGUAGE_C_PLUS_PLUS' to the CXXFLAGS line. This makes it get the right definition for signal functions (has an 'int' arg).
    make
    make install
    
  12. Unpack 'kdebase' and enter its directory. Do:
    ./configure --prefix=$KDEDIR
    find . -name Makefile -exec ../FixMakesSq {} \;
    
  13. Fix 'memory_sgi.cpp' (do a find from 'kdebase' directory). I just #ifdef'd out the contents of the whole function... it doesn't compile on my machine, and I never open that part of KPanel anyway :-).
    make
    make install
    
  14. Unpack 'kdeutils'.
    ./configure --prefix=$KDEDIR
    find . -name Makefile -exec ../FixMakesSq {} \;
    
  15. Find 'kcalc_core.cpp' and fix its Makefile like you did for 'kprocctrl.cpp' above.
    make
    make install
    
  16. Unpack 'kdegames', 'kdegraphics', and 'kdetoys' and for each one, enter its directory and do:
    ./configure --prefix=$KDEDIR
    find . -name Makefile -exec ../FixMakesSq {} \;
    make
    make install
    
  17. This step is optional. Find where the knotes directory is. Go there, do a 'make clean', then change the CXXFLAGS in its Makefile. The CXXFLAGS line has '-O2', change that to '-g'. Then do a 'make' and 'make install'. The reason for this is that I found knotes crashed within a few minutes of it starting up; however, when I recompiled it with '-g' (i.e., debugging support) instead of '-O2' (optimization) it ran fine. Go figure :-).

And that's it. You should now be able to run KDE.

4.8 Installing the RPMs with SuSe's YaST makes the rpm database unusable. What can I do?

If you do get

   error -2 reading header: Unknown error

you have to update rpm:

rpm -U ftp://ftp.suse.com/pub/suse_update/suse51/rpm/rpm.rpm

and you should also update YaST

rpm -U ftp://ftp.suse.com/pub/suse_update/suse51/a1/yast.rpm

The packages were built using rpm-2.4.12 and cannot be installed by some old versions of rpm. this mostly happens to SuSe Linux users. Version 5.0 of their distribution ships with rpm-2.4.1

You can find out which version your rpm is with:

rpm -qi rpm

4.9 Should I remove old version xyz before installing a new one?

In principle, this is not necessary. RPM and DEP packages should take care of all dependencies.

If you compile the source code yourself, you might take care not to compile different versions of the KDE packages. So if you install a new version, please first make and install kdesupport, then kdelibs, then kdebase.

One thing you should avoid: Installing two (or more, of course) versions of KDE in parallel. This might happen if you specify a different target directory for one version than for the other. The result may be unpredictable. The same is true if you have different versions of Qt installed at the same time. This happens easily if you already have an old Qt version installed with a Linux distribution.

4.10 How do I start KDE?

The most comfortable method to start KDE is to use the startkde script. Simply put the line

startkde
at the end of your .xsession file (or into your .xinitrc file, if you are not using kdm or xdm). Please also remove the lines that started your previous window manager. If there is no .xsession or .xinitrc in your home directory, simply create a new one that just contain one line saying "startkde" (without the quotes!).

4.11 Whenever I start KDE, it complains about "shadow passwords". Why?

When your system uses shadow passwords, the screensaver can only run properly if the suid bit is set. This bit gives the screensavers root privileges, which are needed to access the shadow passwords. (Remember: the screensavers might be configured to secure the machine until the password is entered.)

To set the suid bit on the screensavers, you (or the systems administrator) must issue the following commands as root:

chown root $KDEDIR/bin/*.kss
chmod u+s $KDEDIR/bin/*.kss

Alternatively, if you compile KDE from source, you can use

./configure --with-shadow

to configure kdebase. Then the suid bit is set automatically during make install.

4.12 Is it possible to install KDE in a user directory?

You can install KDE in every directory you want. What you have to do depends on the kind of packages you want to install:

Source packages

To configure, use a command like:

configure --prefix=/users/myhome/kde; make; make install

to install into /users/myhome/kde.

After you have installed the packages in the user directory, you should add the following to your init files. Please note that if it isn't necessary for you to set LD_LIBRARY_PATH, it's better to leave it out.

For csh or tcsh:

setenv KDEDIR /users/myhome/kde

if ( $?LD_LIBRARY_PATH ) then
   setenv LD_LIBRARY_PATH $KDEDIR/lib:$LD_LIBRARY_PATH
else
   setenv LD_LIBRARY_PATH $KDEDIR/lib
endif

if ( ! $?LIBRARY_PATH ) then
   setenv LIBRARY_PATH $LD_LIBRARY_PATH
endif  

For bash, please use:

KDEDIR=/users/myhome/kde
PATH=$KDEDIR/bin:$PATH
LD_LIBRARY_PATH=$KDEDIR/lib:$LD_LIBRARY_PATH
LIBRARY_PATH=$LD_LIBRARY_PATH

export KDEDIR PATH LD_LIBRARY_PATH LIBRARY_PATH

RPM packages

rpm allows you to use the -prefix option to select the directory to for installtion, e.g.

rpm -i -prefix=/users/myhome/kde package.rpm

Problems to expect

KDE will run from the users directory. There are some problems with programs that require SUID root, e.g. the programs in the kdeadmin package, but they are not meant to be run by users, so this is nothing to worry about.

However, on systems using shadow passwords, the screensavers have to be run SUID root to enable password access for unlocking the screen, so this option will not work.

4.13 startkde fails with "can not connect to X server". What is wrong?

You probably tried to start the X-Server with startkde. The X-Server is started with startx. startkde is the script that should be run in your .xinitrc or .xsession to activate the window manager and the necessary server daemons for KDE. See also: How do I start KDE?.

4.14 Installing Debian packages with dpkg says "giflib2 is missing"

Sometimes, when installing KDE Debian packages, dpkg complains about "dependency problems: giflib2 is missing". As the giflib2 is not needed, the solution is simple:

dpkg -i --ignore-depends=giflib2 package.deb

4.15 KDE on AIX?

If you have trouble building KDE on AIX check out Stefan Westerfeld's KDE on AIX page for lots of help on building KDE on this 'exceptional' Unix variant.

4.16 Installing Redhat packages says "libncurses.so.3.0 is needed"

If there isn't a rpm for it on your Redhat CD, poke around the Redhat FTP site and its mirrors to get it. Do bear in mind that libncurses-3 and -4 coexist so there is no need to replace one with the other, i.e. a plain rpm -i will do.

Or you might try the following:

cd /usr/lib
ln -s libncurses.so.4 libncurses.so.3
ldconfig
rpm -i --nodeps kdebase...

Since libncurses-3 and -4 are 100% compatible both at binary and at source level, installing two versions is just a waste of space.

4.17 KDE on a laptop?

If you can get X to run, you shouldn't have a problem getting KDE to run on it. In addition, you might find the following links helpful:

For laptops with exotic resolution like 1024x600, You can try editing the XF86Config file (in /etc/X11 if you use RedHat). If you have some experience with this file, you will know that there are several different "Modeline" lines in it. You only have to add a Modeline for your resolution. Unfortunately, the format of the Modeline lines is pretty esoteric; i.e., you'd have to read up a lot. One source of information could be the XFree86 Video Timings HOWTO.

4.18 I don't like the default KDE directory after installation. How do I move it without breaking anything?

Assuming the default is /opt/kde and you want to move it to /usr/local/kde. Here's what you've to do:

  1. change to superuser if you aren't already
  2. mv /opt/kde /usr/local/kde
  3. ln -s /usr/local/kde /opt/kde

This will put all your KDE files in /usr/local/kde but everything is still accessible with /opt/kde.

4.19 Where has the snapshot configure script gone?

Maybe this has already been rectified, but just in case it isn't, here's the solution:

make -f admin/Makefile.common cvs

4.20 How do I unzip tarballs with the 'bz2' extension?

First, you need the bzip2 package. Get it from your favourite FTP site if you haven't already got one. Next, to view the contents, simply do this:

$ bzip2 -cd files.tar.bz2 | tar tvf -

To extract, do this instead:

$ bzip2 -cd files.tar.bz2 | tar xvf -

Of course, you can also use something like:

"tar --use-compress-program bzip2 -xvf files.tar.bz2"
. Please "man tar" and "man bzip2" for further information, and you might also want to read up the Bzip2 mini-HOWTO. By the way, the Bzip2 home page is at http://www.muraroa.demon.co.uk/.

4.21 What files can I delete from my KDE install directory? Can all the *.h, *.c and *.o files be safely removed?

There shouldn't be any need to keep the .c and .o files, but you might want to keep the .h files, as they are used by includes if you ever want to compile your own KDE programs. Or if you wish to add patches to the source programs as they become available (rather than downloading everything again), then they should stay.

4.22 Will I lose my current settings when I upgrade KDE?

No, your settings will be fine even if you let's say remove your old RPM packages first (rpm -e <Packagename>.i386.rpm). This is because your KDE settings are kept in a folder in your home directory called 'Desktop' (as well as in some .files) while KDE itself is normally installed into a directory available system wide like /opt/kde.

But of course, it is always advisable to backup. Other than your personal config files, backing up $KDEDIR/share/config seems to be a good idea, too.

If you have enough space, move /opt/kde to /opt/ke10, say, and install onto /opt/kde11. Do the same with $HOME/.kde and also back up $HOME/Desktop. Use symbolic links /opt/kde and $HOME/.kde to get the installation prefix right without changing the environment variables, and also to switch between KDE 1.0 and 1.1. Do the same with Qt.

4.23 Compiling kdebase gives me a "bin/sh: msgfmt: command not found" error!

You need the GNU msgfmt which is part of the GNU i18n package 'gettext'. You should be able to download it from any decent GNU mirrors.

4.24 Compiling KDE using gcc in Solaris 2.6 but keep on getting errors.

The main problem seems to be the Solaris assembler. Switching to egcs-1.1.1 fixes the compiler crashes and gnu assembler (in "binutils-2.9.1") fixes the assembler problems.

4.25 How do I uninstall KDE apps compiled from scratch?

You can uninstall your programs by typing 'make uninstall' in the directory where you did 'make install'. If you have already nuked away that directory, then there's only one way, and it isn't good: go to $KDEDIR/bin and start deleting files one by one.

4.26 What's up with GIF support?

This has something to do with Unisys' LZW patent. GIF support is turned off in Qt 1.44 by default. Either use an older Qt, or recompile it with GIF support turned on. However, I don't know whether it's legal to do so. Please search the kde-devel mailing list archive for details.

Next Previous Table of Contents