<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 folder and the folder <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.2 or higher. 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 favourite KDE mirror and visit the folder <filename>/pub/kde/stable/distribution/rpm</filename>. There, you can see folders 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 tdesupport, tdelibs and tdebase. 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>tdesupport.arch.rpm</filename></userinput>
<userinput><command>rpm</command> <option>-i</option> <filename>tdelibs.arch.rpm</filename></userinput>
<userinput><command>rpm</command> <option>-i</option> <filename>tdebase.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 tdebase</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-tdenetwork</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdeadmin</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdetoys</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdeutils</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdemultimedia</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdegraphics</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdepim</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdegames</option></userinput>
<userinput><command>apt-get</command> <option>install task-koffice</option></userinput>
<userinput><command>apt-get</command> <option>install tdebase-docs</option></userinput>
<userinput><command>apt-get</command> <option>install tdm</option></userinput>
</screen>

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

<screen><userinput><command>apt-get</command> <option>install
tde-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 TDE 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 folders. </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 tdebase</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-tdenetwork</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdeadmin</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdetoys</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdeutils</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdemultimedia</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdegraphics</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdepim</option></userinput>
<userinput><command>apt-get</command> <option>install task-tdegames</option></userinput>
<userinput><command>apt-get</command> <option>install task-koffice</option></userinput>
<userinput><command>apt-get</command> <option>install tdebase-docs</option></userinput>
<userinput><command>apt-get</command> <option>install tdm</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 favourite KDE mirror and retrieve the following files from the folder <filename>/pub/kde/stable/<replaceable>newest version</replaceable></filename>:</para>

<itemizedlist>
<listitem><para><filename>tdesupport-<replaceable>version</replaceable>.tar.gz</filename></para></listitem>
<listitem><para><filename>tdelibs-<replaceable>version</replaceable>.tar.gz</filename>
</para></listitem>
<listitem><para><filename>tdebase-<replaceable>version</replaceable>.tar.gz</filename></para></listitem>
<listitem><para>any other packages you wish to install. We advise you to get at least tdeutils. </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 folder structure:</para>

<itemizedlist>
<listitem><para><filename>/usr/src/tdesupport</filename></para></listitem>
<listitem><para><filename>/usr/src/tdelibs</filename></para></listitem>
<listitem><para><filename>/usr/src/tdebase</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 folder 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 a small part of the result of <command>configure <option>--help</option></command> in tdelibs:</para>

<screen><computeroutput>
 Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local/kde-cvs]
...
Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-fast-perl     disable fast Makefile generation (needs perl)
  --enable-debug=ARG    enables debug symbols (yes|no|full) default=no
  --disable-debug         disables debug output and debug symbols default=no
  --enable-strict         compiles with strict compiler options (may not work!)
  --disable-warnings      disables compilation with -Wall and similar
... 
</computeroutput>
</screen>

<para>Several options are not required and are only useful as workarounds for known problems (&eg; <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 tdesupport and tdelibs) or where to look for libraries (for the other packages). By default, configure will look in <filename>/usr/local/kde</filename> . If you want to install &kde; into <filename>/opt/kde</filename>, you have to use <command>configure <option>--prefix /opt/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: arts, tdelibs, then the application packages (for example tdebase). All the application packages should only depend on tdelibs, 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 folder, 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 TDEDIR=/opt/kde
</screen>
 </para>
<para>Next, edit the .xinitrc file in your home folder. Look for the line that calls your window manager and replace it with <literal>starttde</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>
