<chapter id="installation">
<title>Installation </title>

<epigraph>
<attribution>Linus Torvalds, after finding one of his file systems smashed by a
new Beta kernel</attribution>
<para>Core dumping fsck's tend to make me nervous</para>
</epigraph>

<para>Don't worry!  Although the use of some Beta software can cause
considerable grief, it is unlikely that the installation of KDE will trash your
hard disk.  In fact, this chapter is designed to guide you through the
installation process, so that you can take a look at your new desktop as quickly
(and with as little grief) as possible. As with all new Window Manager installs,
it is recommended that you back up all your X11-specific configuration files
before you begin the install. If you do not know the exact location of them, try
all the hidden (<filename>.*</filename>) files in your home directory and the directory
<filename>/usr/X11/lib/X11/xdm</filename>.  </para> 

<sect1 id="requirements">
<title>Requirements </title>

<para>Before installing KDE, ascertain that your system fulfills the following
requirements: </para>

<itemizedlist>

<listitem><para>A running POSIX compatible UNIX system. UNIX's that are known to
work with KDE include: Linux, FreeBSD, Solaris, HP-UX, and MkLinux. We are
working to make KDE available for more platforms soon. </para></listitem>

<listitem><para>Some free hard disk space on the partition where
<filename>/opt/kde</filename> will be created. We recommend that you reserve
about 50MB if your system supports shared libraries, and considerably more if it
does not.  If you need or want to build KDE from the source tree, please
remember to reserve about 100MB in <filename>/usr/src</filename>.</para></listitem>

<listitem><para>A running X11 system with or without
<application>xdm</application>. If you have not installed the X Window System
yet, first check your UNIX installation media for an installable version.  If
you cannot find any version working, visit <ulink
url="http://www.xfree86.org">the XFree86 web site</ulink> for more information
on how to get and install the X Window System, or contact your UNIX vendor
support. </para></listitem>

<listitem><para>The Qt libraries, version 3.0.2. You can obtain these at <ulink
url="ftp://ftp.trolltech.com/qt">Troll Tech's FTP Server</ulink> in tgz format.
</para>
</listitem>
</itemizedlist>

<warning><para>A warning before you start: Before upgrading from a previous
version of KDE, we recommend that you do the following:</para>

<screen> 
<command>cd <filename>/opt/kde</filename></command> 
<command>tar <option>cfvz <replaceable>~/KDE-old-version-backup.tar.gz</replaceable> * </option></command>
</screen>
</warning>

</sect1>

<sect1 id="linux-installing-rpms">
<title>Linux: Installing RPMs for RedHat, Caldera and SuSE.</title>

<para>Using RPMs is the easiest method to get KDE up and running. Just visit
your favorite KDE mirror and visit the directory
<filename>/pub/kde/stable/distribution/rpm</filename>.  There, you can see
directories for different operating systems. Currently, the i386, alpha and
sparc architectures are supported. The RPM packages can also be found on the Red
Hat contrib sites like sunsite.unc.edu or ftp.redhat.com. </para>

<para>The basic system consists of the files
<filename>kde-<replaceable>component</replaceable>.<replaceable>architecture</replaceable>.rpm</filename>
You need at least kdesupport, kdelibs and kdebase. After getting the base
distribution, feel free to download any other RPMs that you think may come in
handy.  </para>

<para>Next, start installing with the base package. If you are installing KDE
for the first time, use </para>

<screen> 
<userinput><command>rpm</command> <option>-i</option> <filename>kdesupport.arch.rpm</filename></userinput>
<userinput><command>rpm</command> <option>-i</option> <filename>kdelibs.arch.rpm</filename></userinput>
<userinput><command>rpm</command> <option>-i</option> <filename>kdebase.arch.rpm</filename></userinput>
</screen>
 
<important><para>It is important that these components are installed in the
order listed, and that they are installed before any other KDE
component.</para></important>

<para>If you are upgrading from a previous release, try
<screen> 
<userinput><command>rpm</command> <option>-Uvh</option> <filename>kde-<replaceable>component</replaceable>.<replaceable>arch</replaceable>.rpm</filename></userinput>
</screen>
</para>

<para>Once again, the order given above should be preserved, and the given
components should be installed before any other KDE components.</para>

<para>This will unpack the base distribution and install it by default in
<filename>/opt/kde</filename>.</para>

<para>If the installation of the base packages has been successful, you can
install the remaining packages (use <option>-Uvh</option> instead of
<option>-i</option> once again to update an existing version) the same
way. </para>

</sect1>

<sect1 id="installing-debian">
<title>Linux: Installing <acronym>DEB</acronym>s for debian</title>

<para>The installation for a Debian system is also rather straightforward.  You
will only find KDE 2.0 packages for Debian 2.2 (Potato) and 3.0 (Woody). We
describe here how to install packages for Debian 2.2, the stable version,
since Debian 3.0 is still in development. However, the installation for both
versions, is almost identical. The main difference is that KDE is officially
included in Debian 3.0 and you do not need to specify any special location to
find the deb packages for KDE.</para>

<para>The first step is to tell your system where it can find the deb packages
for KDE.  A list of locations for the Debian packages is kept on your hard disk
in <filename>/etc/apt/sources.list</filename>. You should add to that file the
following line: <userinput>http://kde.tdyc.com/ stable kde2</userinput></para>

 
<para>Then you have to update your local package database so that your system
knows that there are new packages available. Type the following command:</para>

<screen>
<userinput><command>apt-get</command> <option>update</option></userinput>
</screen>
 
<para>Finally you should install the KDE base components. This is accomplished by
typing:</para>

<screen>
<userinput><command>apt-get</command> <option>install kdebase</option></userinput>
</screen>
 
<para>If you want to install other components you should try some, or all of these
options:</para>

<screen>
<userinput><command>apt-get</command> <option>install task-kdenetwork</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdeadmin</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdetoys</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdeutils</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdemultimedia</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdegraphics</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdepim</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdegames</option></userinput>
<userinput><command>apt-get</command> <option>install task-koffice</option></userinput>
<userinput><command>apt-get</command> <option>install kdebase-docs</option></userinput>
<userinput><command>apt-get</command> <option>install kdm</option></userinput>
</screen>

<para>You may also be interested in installing your language.</para>

<screen>
<userinput><command>apt-get</command> <option>install
kde-i18n-<replaceable>xx</replaceable></option></userinput>
 </screen>
<para>where <replaceable>xx</replaceable> has to be substituted by the country
code.</para>

<para>The control files for some KDE applications will be placed at <filename
class="directory">/etc/kde2</filename>, the executables will go in <filename
class="directory">/usr/bin</filename> and most of the auxiliary files in
<filename class="directory">/usr/share</filename> under  different
directories. </para>

<para>If you are upgrading from a previous version of KDE you should perform the
following steps. First, update file <filename>/etc/apt/sources.list</filename>
by changing the line with the location of KDE packages with line:
<userinput>http://kde.tdyc.com/ stable kde2</userinput>. Second update your
package database:</para>

<screen>
<userinput><command>apt-get</command> <option>update</option></userinput>
</screen>
 
<para>Finally install the KDE base system:</para>

<screen>
<userinput><command>apt-get</command> <option>install kdebase</option></userinput>
<userinput><command>apt-get</command> <option>dist-upgrade</option></userinput>
</screen>
 
<para> If you want to install more KDE components try some, or all of these
options.</para>

<screen>
<userinput><command>apt-get</command> <option>install task-kdenetwork</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdeadmin</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdetoys</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdeutils</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdemultimedia</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdegraphics</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdepim</option></userinput>
<userinput><command>apt-get</command> <option>install task-kdegames</option></userinput>
<userinput><command>apt-get</command> <option>install task-koffice</option></userinput>
<userinput><command>apt-get</command> <option>install kdebase-docs</option></userinput>
<userinput><command>apt-get</command> <option>install kdm</option></userinput>
</screen>

</sect1>

<sect1 id="source-distribution">
<title>Using Source Compilation to Install on Top of Other Systems </title>

<para>If your Linux distribution did not come with an RPM or DEB archive format,
or you are not using Linux at all, you must compile KDE on your own. In the
future, we are planning to provide a binary distribution which includes its own
installation program. </para>

<para>In order to compile and install KDE properly, you need to have the
following items installed on your hard disk: </para>

<itemizedlist>
<listitem><para>An ANSI-C compiler, <abbrev>e.g.</abbrev> the
<abbrev>GNU</abbrev> C compiler. </para></listitem>
<listitem><para>An ANSI-C++ compiler, <abbrev>e.g.</abbrev> <abbrev>GNU</abbrev>
C++. </para></listitem>
<listitem><para>The <application>make</application> utility. </para></listitem>
<listitem><para>Qt development version 2.2 or higher.</para></listitem>
<listitem><para>X11 development version (include files are often missing)
</para></listitem>
</itemizedlist>

<para>Once you have all the needed helper applications, go to your favorite  
KDE mirror and retrieve the following files from the directory 
<filename>/pub/kde/stable/<replaceable>newest
version</replaceable></filename>:</para>

<itemizedlist>
<listitem><para><filename>kdesupport-<replaceable>version</replaceable>.tar.gz</filename></para></listitem>
<listitem><para><filename>kdelibs-<replaceable>version</replaceable>.tar.gz</filename>
</para></listitem>
<listitem><para><filename>kdebase-<replaceable>version</replaceable>.tar.gz</filename></para></listitem>
<listitem><para>any other packages you wish to install. We advise you to get at
least kdeutils. </para></listitem>
</itemizedlist>

<para>In all cases above, <replaceable>version</replaceable> stands for the
current version number. Once you have downloaded all you need, extract these
files to <filename>/usr/src</filename>.  This process should yield the following
directory structure:</para>

<itemizedlist>
<listitem><para><filename>/usr/src/kdesupport</filename></para></listitem>
<listitem><para><filename>/usr/src/kdelibs</filename></para></listitem>
<listitem><para><filename>/usr/src/kdebase</filename></para></listitem>
<listitem><para><filename>/usr/src/...</filename> (any other
packages)</para></listitem>
</itemizedlist>

<para>Make sure you have write permissions to
<filename>/opt/kde</filename>.</para>

<para>Next you must compile and install the packages using the following:
</para>

<procedure>
<step><para><command>cd</command> into the directory of the package, you want to
install (see above)</para></step>
<step><para><command>./configure</command> (with the options you want to
apply)</para></step>
<step><para><command>make</command></para></step>
<step><para><command>make install</command></para></step>
</procedure>

<para>Apply the above steps to every package you want to install.</para>

<note><para>These instructions can be used for almost every source package
available, not just KDE packages. </para></note>

<para>Every configure script has several options available. Some are common
between the packages while others are specific to an individual package. The
following is part of the result of <command>configure
<option>--help</option></command> in kdelibs:</para>

<screen>
<computeroutput>
  --disable-fast-perl     disable fast Makefile generation (needs perl)
  --enable-debug          creates debugging code [default=no]
  --enable-strict         compiles with strict compiler options (may not work!)
  --enable-profile        creates profiling infos [default=no]
  --enable-final          build size optimized apps (experimental - needs lots of memory)
  --disable-closure       don't delay template instantiation
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=no]
  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --with-pic              try to use only PIC/non-PIC objects [default=use both]
  --with-extra-includes=DIR
                          adds non standard include paths
  --with-extra-libs=DIR   adds non standard library paths
  --with-qt-dir=DIR       where the root of Qt is installed
  --with-qt-includes=DIR  where the Qt includes are.
  --with-qt-libraries=DIR where the Qt library is installed.
  --disable-rpath         do not use the rpath feature of ld
  --disable-path-check    don't try to find out, where to install
  --with-xdmdir           If the xdm config dir can't be found automaticly
  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]
  --with-shadow           If you want shadow password support
  --with-krb4[=PATH]      Compile in Kerberos v4 support.
  --with-afs              Compile in AFS support (requires KTH krb4).
  --with-ldap[=PATH]      Compile in LDAP support.
  --with-samba-libs=path  Use Samba-tng libs in 'path'                [search]
  --without-gl            disable 3D GL modes
  --without-xpm           disable color pixmap XPM tests
  --without-dpms          disable DPMS power saving
  --with-x                use the X Window System
  --with-motif-includes=DIR    Motif include files are in DIR
  --with-motif-libraries=DIR   Motif libraries are in DIR                           
</computeroutput>
</screen>

<para>Several options are not required and are only useful as work arounds
for known problems (<abbrev>e.g.</abbrev>
<option>--disable-FEATURE</option>). Since some are important options, for
instance <emphasis>--with-shadow</emphasis>, you should always check the
available options.</para>

<para>An important option is <option>--prefix</option>. This option specifies
the path where configure should install (for kdesupport and kdelibs) or where to
look for libraries (for the other packages). By default, configure will look in
<filename>/opt/kde</filename> . If you want to install KDE into
<filename>/usr/local/kde</filename>, you have to use <command>configure
<option>--prefix /usr/local/kde</option></command>.</para>

<para>If you have installed the Qt libraries in an uncommon place, for instance
in <filename>$HOME/src/qt</filename>, you must use <command>configure
<option>--with-qt-dir=$HOME/src/qt</option></command>. By default configure
looks in the most common places for Qt before it gives up.</para>

<para>If you have problems that you are not able to solve, send
a copy of the <filename>config.log</filename> file to the address given in the
offending package's <filename>README</filename> file.</para>

<para>You must install KDE in the following order: kdesupport, kdelibs, then the
application packages (for example kdebase). All the application packages should
only depend on kdelibs, so you can compile them at the same time (if you have a
powerful machine).</para>

<para>If you want to take advantage of multiprocessor systems, try <command>make
<option> -j <replaceable>Number of processors</replaceable></option></command>
instead of <command>make</command>. </para>

<sect2>
<title>Platform Specific Building Notes </title>

<sect3>
<title>Linux </title>

<para>For Linux, most of the utilities needed to build KDE can be found either
at <ulink
url="ftp://sunsite.unc.edu/pub/Linux/GCC">ftp://sunsite.unc.edu/pub/Linux/GCC</ulink>
or <ulink
url="ftp://sunsite.unc.edu/pub/GNU">ftp://sunsite.unc.edu/pub/GNU</ulink>. The
Qt libraries can be found at <ulink
url="ftp://ftp.troll.no/pub/qt/source">ftp://ftp.troll.no/pub/qt/source</ulink>,
available as source code. Detailed instructions on how to install them are provided.
Include files for X11 programs should be available at
<ulink url="ftp://ftp.xfree86.org">ftp://ftp.xfree86.org</ulink> in the xdevel
section.  </para>

</sect3>
</sect2>
</sect1>

<sect1 id="suse-install">
<title>Required Changes To Your Configuration Files </title>
<para> 
After you have placed the KDE binaries into their destination directory,  
there are a few adjustments you must make to your startup scripts.  </para>
<para> 
The following procedure was tested on SuSE Linux 5.0, and should be compatible 
with the other popular UNIX's as well. <emphasis>Always make backups of  
configuration files before changing them!</emphasis> Add the following to  
the end of your /etc/profile: </para>
<para> 
<screen>export PATH=$PATH:/opt/kde/bin 
export KDEDIR=/opt/kde
</screen>
 </para>
<para>Next, edit the .xinitrc file in your home directory. Look for  
the line that calls your window manager and replace it with <literal>startkde</literal>.</para>
<para>Now that everything needed to run KDE has been installed, you can go on  
to chapter 4 where you will start KDE for the first time. If something goes  
wrong, you may need to compile KDE on your own. Read<emphasis>  
<link linkend="source-distribution">Using Source Compilation to Install on Top of Other Systems</link> </emphasis>for more information.  </para>
<para>We have made the installation as bulletproof as possible, so you
should not encounter any serious problems unless your configuration is
exotic. If you do experience difficulties feel free to use
<link linkend="mailing-lists">the KDE mailing lists</link>    </para>
</sect1>
</chapter>
