LDP/LDP/howto/docbook/Glibc-Install-HOWTO.xml

570 lines
32 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []>
<book id="Glibc-Install-Mini-Howto" lang="en">
<bookinfo>
<title>Glibc Installation HOWTO</title>
<author>
<firstname>Kai</firstname>
<surname>Schlachter</surname>
<affiliation><address>
<email>linux (at) murphyslantech.de</email>
</address></affiliation>
</author>
<pubdate>2004-03-19</pubdate>
<revhistory id="revhistory">
<revision>
<revnumber>1.01</revnumber>
<date>2004-03-19</date>
<authorinitials>KC</authorinitials>
<revremark>Initial Release, reviewed by LDP</revremark>
</revision>
</revhistory>
</bookinfo>
<chapter id="preface">
<title>Preface</title>
<sect1 id="copyright">
<title>Copyright</title>
<para>Copyright (c) 2004 by Kai Schlachter</para>
<para>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is located at <ulink url="http://www.gnu.org/licenses/fdl.html" />.</para>
</sect1>
<sect1 id="history">
<title>Revision History</title>
<para>
<itemizedlist>
<listitem><para>v1.01: Fixed some missplaced quotation marks</para></listitem>
</itemizedlist>
</para>
</sect1>
<sect1 id="thanks">
<title>Thanks</title>
<para>I especially want to thank Nico Schmoigl for helping me get
my crashed system back up after I ran <command>make install</command> for
glibc while my system was still fully running. This was the main reason I wrote this mini-HOWTO.
</para>
<para>Thanks also go to all the other people who helped me along the way; getting the HOWTO in correct format, finding all the typos, etc.</para>
</sect1>
</chapter>
<chapter id="introduction">
<title>Introduction</title>
<para>In this HOWTO I will explain how you install a new version
of <productname>glibc</productname> on your system.</para>
<para>I wrote this manual because I want to save others from the
problems I encountered.</para>
<para>This HOWTO is a kind of guideline, made up from settings and ways of
doing things that worked out for me. No liability for the contents of this document can be accepted. Use the concepts, examples and other content at your own risk. You are strongly recommended to make a backup of your system before major installations and backups at regular intervals.</para>
<para>If you have any suggestions, found another bug in some
distribution and how to fix it, please let me know by writing me
an e-mail: <email>linux_at_murphyslantech.de</email>.</para>
<sect1 id="why">
<title>Why?</title>
<para>
Yes, that's a good question. Why would you need to install a new
glibc? Well, there are several reasons:
<itemizedlist>
<listitem><para>you are a developer and you need the new functions of the library</para></listitem>
<listitem><para>you wanted to compile a new program that needs the new library</para></listitem>
<listitem><para>you like the thrill of errors and bugs in new versions ;-)</para></listitem>
</itemizedlist>
</para>
</sect1>
<sect1 id="what">
<title>What?</title>
<para>
If you do not know what glibc is by now, don't worry! When I
first had problems with a new program I wanted to compile, I only
knew that my version of glibc was not sufficient for the
compile. Now that I know more, I will try to explain in a very simple way what
glibc does.</para>
<para>The glibc package contains a library written in the
programming language of C. Libraries are a very useful thing in programming;
instead of inventing the wheel from scratch for operations such as
computing the square-root of a number, such common functions
are stored in separate files&mdash;the so-called libraries.
When a new version of a library is published it often contains
some new functions, uses more efficient algorithms for already
implemented functions, and so on.</para>
<para>This is the reason why some programs complain about an older
version of glibc: the current version just does not contain all the functions
the program needs in order to run.</para>
<para>I know this is not technically correct in all detail, but it
gives you a basic understanding of the architecture behind.</para>
</sect1>
</chapter>
<chapter id="preparations">
<title>Preparations</title>
<para>
As an installation of glibc is not an easy task. You need to do a lot of things in advance, especially in the event that something goes
wrong. (That is what happened to me on my first glibc install, and I did not make any preparations.)</para>
<!-- Pehaps write a certain todo-list about what we are going to do ... -->
<sect1 id="stuff-you-will-need">
<title>Stuff you will need</title>
<para>Basically, you need two different things: software that is already running on your machine (eg., pre-installed by your distribution) and packages
of source-code for different programs.</para>
<sect2 id="software-you-will-need">
<title>Software you will need</title>
<para>
<itemizedlist>
<listitem><para>a running <productname>gcc</productname></para></listitem>
<listitem><para>an older version of <productname>glibc</productname> ;-)</para></listitem>
<listitem><para><productname>GNU-binutils</productname></para></listitem>
<listitem><para><productname>GNU-make</productname></para></listitem>
<listitem><para>the <productname>GNU-core-utils</productname></para></listitem>
<listitem><para><productname>GNU-tar</productname></para></listitem>
<listitem><para><productname>bash</productname> or any shell you prefer</para></listitem>
<listitem><para>very useful but not a must: <productname>Midnight Commander</productname></para></listitem>
<listitem><para>an editor you like (<productname>vi, jed</productname>, etc.)</para></listitem>
</itemizedlist>
</para>
</sect2>
<sect2 id="sources-you-will-need">
<title>Sources you will need</title>
<para>
<itemizedlist>
<listitem><para><productname>bash</productname>or the shell you like</para></listitem>
<listitem><para><productname>GNU-tar</productname></para></listitem>
<listitem><para><productname>GNU-core-utils</productname></para></listitem>
<listitem><para><productname>GNU-make</productname></para></listitem>
<listitem><para>of course:<productname>glibc</productname></para></listitem>
<listitem><para>possibly: <productname>gcc</productname></para></listitem>
</itemizedlist>
</para>
</sect2>
</sect1>
<sect1 id="special-things-you-need-to-do">
<title>Special things you need to do</title>
<para>Since you are going to substitute the basic library many programs
rely on, you can imagine the problems that may occur.</para>
<para>For me, it so happened that everything went fine until I typed in
<command>make install</command>. At about halfway through the installation
process I got an error telling me that <command>rm</command> was not able to
run, and I found out that even all the common commands like
<command>cp</command>, <command>ls</command>, <command>mv</command>,
<command>ln</command>, <command>tar</command>, etc., did not work; all told me
that they were not able to find parts of the library they needed.</para>
<para>But there is help available. You can force the compilation of
programs with the libraries compiled into them, so the programs do not need
to look them up from the library.</para>
<para>For that reason, in this chapter, we will compile all the
utilities we need for the install into a static version.</para>
<sect2 id="things-you-will-definitely-need">
<title>Things you will definitely need</title>
<sect3 id="the-gnu-binutils">
<title>The GNU-Binutils</title>
<para>
<orderedlist>
<listitem><para>Get the newest version from: <ulink url="ftp.gnu.org/gnu/binutils">ftp.gnu.org/gnu/binutils</ulink>; at the time of writing, this was version 2.14</para></listitem>
<listitem><para>Open the package: <screen>tar xIvf binutils-2.14.tar.bz2</screen></para></listitem>
<listitem><para>Change to the directory: <screen>cd binutils-2.14</screen></para></listitem>
<listitem><para>Configure the Makefiles: <screen>./configure</screen></para></listitem>
<listitem><para>Compile the sources: <screen>make</screen></para></listitem>
<listitem><para>Install them with: <screen>make install</screen></para></listitem>
</orderedlist>
</para>
<para>
If you run into trouble with the compilation of the binutils,
referring to problems with gettext (indicated by errors like:
<quote>undeclared reference to lib_intl</quote> or similar) please install the
newest version, available from <ulink url="ftp.gnu.org/gnu/gettext">ftp.gnu.org/gnu/gettext</ulink>.</para>
<para>If this does not help, try disabling the native-language support by using: <screen>./configure --no-nls</screen></para>
<para>You don't need to build a static version of the binutils, though it
would not hurt, but I encountered many systems running with very
old versions and ran into errors almost every time, so I think it
is a good idea to mention them here.</para>
</sect3>
<sect3 id="gnu-make">
<title>GNU make</title>
<para>The <command>make</command> command is responsible for the compiling of the sources, calling gcc and all the other programs needed for a compile.
Since you may need to compile something if a problem occurs with the new glibc, it is a good idea to have it
static, otherwise it might not work after an error appears.</para>
<para>
<orderedlist>
<listitem><para>Download the source from <ulink url="ftp.gnu.org/gnu/make/">ftp.gnu.org/gnu/make/</ulink>; at the time of writing the current version was 3.80</para></listitem>
<listitem><para>Unpack the source, eg.: <screen>tar xIvf make-3.80.tar.bz2</screen></para></listitem>
<listitem><para>Change to the created directory: <screen>cd make-3.80</screen></para></listitem>
<listitem><para>Take care that the binaries are built static: <screen>export CFLAGS="-static -O2 -g"</screen></para></listitem>
<listitem><para>Run the configure script: <screen>./configure</screen></para></listitem>
<listitem><para>Compile the stuff: <screen>make</screen></para></listitem>
<listitem><para>Install the binaries: <screen>make install</screen></para></listitem>
<listitem><para>Make a check:<screen>make -v</screen> You should now see the new version installed. If not, check for older binary files and replace them by smlinks to the new version.</para></listitem>
</orderedlist>
</para>
<para>
Congratulations! You have compiled another static-linked program.
</para>
</sect3>
<sect3 id="gnu-core-utils">
<title>the GNU core-utils</title>
<para>The core-utils are commands like: <command>cp</command>, <command>rm</command>, <command>ln</command>, <command>mv</command>, etc. In case of an
error in the installation, these are an absolute requirement to
help bring your system up again, so static binaries are really necessary
here.</para>
<para>
<orderedlist>
<listitem><para>Again, download the source tarball from: <ulink url="ftp.gnu.org/gnu/coreutils/">ftp.gnu.org/gnu/coreutils/</ulink>; at the time of writing, version 5.0 was current.</para></listitem>
<listitem><para>Unpack it: <screen>tar xIvf coreutils-5.0.tar.bz2</screen></para></listitem>
<listitem><para>Change to the directory: <screen>cd coreutils-5.0</screen></para></listitem>
<listitem><para>Take care that the binaries are built static:<screen>export CFLAGS="-static -O2 -g"</screen></para></listitem>
<listitem><para>Configure the package: <screen>./configure</screen></para></listitem>
<listitem><para>Compile the binaries: <screen>make</screen></para></listitem>
<listitem><para>And install them: <screen>make install</screen></para></listitem>
<listitem><para>Verify that the right core-utils are used: <screen>cp --version</screen>. You should see the correct version, otherwise remove any old binaries and replace them with symlinks to the new version.</para></listitem>
</orderedlist>
</para>
<para>
Now that the binaries of these very elementary tools are static,
you can be sure they will work every time you need them.
</para>
</sect3>
<sect3 id="gnu-tar">
<title>GNU tar</title>
<para>You have already used GNU tar to unpack all the programs compiled
and installed so far. But maybe you need to compile another
program which is needed by glibc after you had a crash, and in
this situation (I experienced this myself!) it is very useful to
have a working <command>tar</command> ready to unpack the missing programs.
With tar, we also need to take care of the
bz2 compression algorithm, which is not included in the normal
source distribution of tar.</para>
<para>
<orderedlist>
<listitem><para>Get the source of GNU tar from <ulink url="ftp.gnu.org/gnu/tar">ftp.gnu.org/gnu/tar</ulink>; at the time of writing, version 1.13 was up-to-date.</para></listitem>
<listitem><para>As many source tarballs are compressed with bzip2, we would like to have the support built in, rather than working with pipes, so get the patch from:
<ulink url="ftp://infogroep.be/pub/linux/lfs/lfs-packages/4.1/tar-1.13.patch">ftp://infogroep.be/pub/linux/lfs/lfs-packages/4.1/tar-1.13.patch</ulink>.
</para></listitem>
<listitem><para>Unpack the source by invoking: <screen>tar xzvf tar-1.13.tar.gz</screen></para></listitem>
<listitem><para>Copy the patch to the source directory of tar: <screen>cp tar-1.13.patch tar-1.13/</screen></para></listitem>
<listitem><para>Apply the patch: <screen>patch -Np1 -i tar-1.13.patch</screen></para></listitem>
<listitem><para>Set the compiler flags to make a static binary: <screen>export CFLAGS="-static -O2 -g"</screen></para></listitem>
<listitem><para>Now we are ready to configure: <screen>./configure</screen></para></listitem>
<listitem><para>Compile with: <screen>make</screen></para></listitem>
<listitem><para>And as the next step, install the package:<screen>make install</screen></para></listitem>
<listitem><para>Do a quick check to ensure the new version is being used from now on: <screen>tar --version</screen> The version you just installed should display, otherwise
check for old binaries and replace them with symlinks to the new location.</para></listitem>
</orderedlist></para>
<para>If you experience problems with the execution of <command>make</command>, try to turn
off native-language support (nls). You may achieve this by
invoking configure with the option: <screen>--disable-nls</screen></para>
<para><emphasis>Note:</emphasis> In this new version of tar, you must use the <option>-j</option> switch to
decompress .bzip2 files, so instead of <screen>tar xIvf anyfile.tar.bz2</screen> you now have to use <screen>tar xjvf anyfile.tar.bz2</screen> I
do not know why this was changed, but it works fine.</para>
</sect3>
<sect3 id="the-bash">
<title>The Bash shell</title>
<para>
I prefer Bash as my shell; if you use a different one, please be sure you have installed a static version of it before you install glibc.</para>
<para>
<orderedlist>
<listitem><para>Get Bash from: <ulink url="ftp.gnu.org/gnu/bash/">ftp.gnu.org/gnu/bash/</ulink>. Download the newest
version you can find; at the time of writing this was version 2.05b.</para></listitem>
<listitem><para>Unpack the source tree: <screen>tar xzvf bash-2.05b.tar.gz</screen> which
will create a directory called <filename>bash-2.05b</filename> with all the unpacked sources in it.</para></listitem>
<listitem><para>Go to the directory: <screen>cd bash-2.05a</screen></para></listitem>
<listitem><para>Set everything up for building a static version: <screen>export CFLAGS="-static -O2 -g"</screen></para></listitem>
<listitem><para>Configure the makefiles: <screen>./configure</screen> If you would like something special in your Bash, see <screen>./configure --help</screen>
for a list of options.</para></listitem>
<listitem><para>Compile everything: <screen>make</screen></para></listitem>
<listitem><para>Install the compiled binaries: <screen>make install</screen> This will install the binaries to <filename>/usr/local/bin/</filename>.</para></listitem>
<listitem><para>Make sure there is not another version laying around (like in my Suse-Linux: <filename>/bin/</filename>), by copying the file:
<screen>cp /usr/local/bin/bash /bin/</screen> We don't use a symlink here because both at boot-time and when starting Bash there might be trouble with symlinks.
</para></listitem>
</orderedlist>
</para>
<para>You now have installed a static version of Bash. For that reason,
the binary is much bigger than usual, but it will run under all
circumstances.</para>
<para>
If you prefer to use another shell, you are free to do so, but make
sure it is a statically-linked version. Feel free to email me a method to
build the shell of your choice in a static version, and chances are good
that it will be implemented in the next revision of this document.
</para>
</sect3>
</sect2>
<sect2 id="software-that-may-come-in-handy">
<title>Software that may come in handy</title>
<sect3 id="midnight-commander">
<title>Midnight Commander</title>
<para>
Midnight Commander is a very useful file manager, supporting
many nice features like transparent decompression of packed files,
built-in copy, move and other common commands, as well as an
integrated editor.</para>
<para>To compile this piece of software, you will need to have glib
installed; in some distributions this is already the case. If you
get an error in the <command>make</command> command saying that ld could not
find glib, you will need to install this library first. You can get the sources from:
<ulink url="ftp.gnome.org/pub/gnome/sources/glib/2.2/">ftp.gnome.org/pub/gnome/sources/glib/2.2/</ulink>, and the installation is straight-forward.</para>
<!-- maybe add a short section about the installation of glib -->
<para>Here are the steps to build Midnight Commander:</para>
<para>
<orderedlist><listitem><para>Get the source from
<ulink url="http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/">http://www.ibiblio.org/pub/Linux/utils/file/managers/mc/"</ulink>;
at the time of writing, the newest version was 4.6.0.</para></listitem>
<listitem><para>Unpack the sources: <screen>tar xzvf mc-4.6.0.tar.gz</screen></para></listitem>
<listitem><para>Change to the directory you just created: <screen>cd mc-4.6.0</screen></para></listitem>
<listitem><para>Set up the configuration-files: <screen>./configure</screen></para></listitem>
<listitem><para>Start compiling: <screen>make</screen></para></listitem>
<listitem><para>Install everything: <screen>make install</screen></para></listitem>
</orderedlist>
</para>
</sect3>
</sect2>
</sect1>
</chapter>
<chapter id="the-install-of-glibc-itself">
<title>The installation of glibc itself</title>
<para>Now we come to the most important thing: the glibc install.</para>
<sect1 id="obtaining-and-compiling-the-source">
<title>Obtaining and compiling the source</title>
<para>There are several versions of glibc available, but not in all cases are
new versions really better than the old ones. The best thing you
can do to find out which works and which ones you should not use is to
check out the different forums on the Internet. If you have
someone to ask, talk to him about the topic. Maybe he already has
installed the new version and might be able to tell you that version x.y.z is a
PITA, but version a.b.c works really well!</para>
<para>I decided to install glibc-2.2.4, as I was told it
works well, but it is your decision which one to choose.</para>
<para>Ok, now let's go to work:</para>
<para><orderedlist>
<listitem><para>Get the source from <ulink url="ftp.gnu.org/gnu/glibc/">ftp.gnu.org/gnu/glibc/</ulink>; as I said, I used version 2.2.4.</para></listitem>
<listitem><para>Unpack the source: <screen>tar -xzvf glibc-2.2.4.tar.gz</screen></para></listitem>
<listitem><para>In addition, you will need a package called
<quote>linuxthreads,</quote> found in the <filename>linuxthreads</filename>
directory on
<ulink url="ftp.gnu.org">ftp.gnu.org</ulink>. The file is called: <screen>glibc-linuxthreads-2.2.4.tar.gz</screen> Make sure you get the version that
corresponds to your glibc source tree.</para></listitem>
<listitem><para>Copy the linuxthreads package to your glibc source directory: <screen>cp glibc-linuxthreads-2.2.4.tar.gz glibc-2.2.4</screen></para></listitem>
<listitem><para>Change to the glibc directory: <screen>cd glibc-2.2.4</screen></para></listitem>
<listitem><para>Unpack linuxthreads: <screen>tar xzvf linux-threads-2.2.4.tar.gz</screen></para></listitem>
<listitem><para>Configure the package:<screen>./configure --enable-add-ons=linuxthreads</screen> This will configure the
package in such a way that the linuxthreads are included in the
compile; this is necessary for compliance with other
Linux systems. For example, programs you compile will probably
not run on another machine if you forget to include this
package.</para></listitem>
<listitem><para>Afterwards, start the compilation of glibc:
<screen>make</screen> This may take some time (about half an hour on my
Duron XP, running with 1.5 GHz).</para></listitem>
</orderedlist>
</para>
<para>
Now that the library is compiled, everything is ready for the
installation, but things are not as easy this time.
</para>
</sect1>
<sect1 id="the-installation">
<title>The installation</title>
<para>
To install glibc you need a system with nothing running on it,
since many processes (for example sendmail) always try to use the
library and therefore block the files from being replaced.
Therefore we need a <quote>naked</quote> system, running nothing except
the things we absolutely need. You can achieve this by passing
the boot option <screen>init=/bin/bash</screen> to your kernel. Depending on
your bootloader you may need to do different things. In the following I will explain this using the two most common bootloaders, LILO (LInux-LOader)
and GNU grub, as examples.</para>
<sect2 id="lilo">
<title>LILO</title>
<para>To start the <quote>only-basics</quote> system, reboot your computer and
at the LILO prompt enter the kernel image-name you like to load and
append <screen>init=/bin/bash</screen> to it before pressing
<keycap>Return</keycap>.
If you are planing to replace your glibc more often, it might be a
good idea to add a separate configuration to your
<filename>/etc/lilo.conf</filename>. For details, refer to the man-page of LILO.</para>
</sect2>
<sect2 id="grub">
<title>Grub</title>
<para>Grub is a newer bootloader, with enhanced support for different
operating systems and file system types (eg. it supports booting from
reiserfs partitions). If you would like to know more go to:
<ulink url="http://www.gnu.org/software/grub/">http://www.gnu.org/software/grub/</ulink>, where you will find all the stuff you need.</para>
<para>If you already have Grub installed, you probably use the
text-based front-end to select the kernel you prefer to boot. Grub
has a nice feature&mdash;instead of returning to doing everything by
hand, you can simply select your entry and type <keycap>e</keycap>, which will
bring up an option menu. In this menu you will see the commands Grub
executes prior to booting the kernel. Simply select the line saying
<screen>kernel="/where/your-kernel-is and-options-are"</screen> and press
<keycap>e</keycap> again. Now you can edit this line. Here you just add
<screen>init=/bin/bash</screen> and after pressing <keycap>Return</keycap> to
make the changes take effect, press <keycap>b</keycap> to start booting.</para>
</sect2>
</sect1>
<sect1 id="after-the-kernel-is-booted">
<title>After the kernel is booted...</title>
<para>
...You will find yourself in an absolute minimal bash-environment.</para>
<para>You will not even be asked to enter your username or password!
At this time you are the ultimate super-user; no-one can get
around you because the system is in single-user mode, so be
careful what you are doing. There are no file-rights set or anything else!</para>
<para>Your prompt will probably look like this: <screen>init-x.y#</screen>
At this moment your root (/) has been mounted as read-only, thus
you will not be able to write the new library to your hard drive.
To make it <varname>r/w</varname>, enter the command:
<screen>mount -o remount,rw /</screen>
If your source is located on another partition you must also
mount it, as it is not done for you (for me this means mounting my
raid system): <screen>mount -t reiserfs /dev/md0 /usr/src</screen> As you
see, I defined the file system type, which is needed because
<command>mount</command> does not look anything up in <filename>/etc/fstab</filename>.</para>
<para>Now you can go to the directory containing the source and type
in: <screen>make install</screen></para>
<para>If you like, now might be a good time to pray that everything works out fine... ;-)</para>
<para>If everything went through properly, you will return to your prompt
after the installation without any error message. In all other
cases, please see <xref linkend="troubleshooting" />.</para>
<para>If everything goes fine, run: <screen>ldconfig -v</screen> to update your
library cache.</para>
<para>Congratulations! The library is successfully installed. Now type
in: <command>mount -o remount,ro /</command> to ensure that all the data is
written to the hard drive.</para>
<para>Now start the reboot: <screen>exit</screen>
This will cause an error message saying that you have caused a
kernel-panic. If possible, restart the computer by using
<keycombo><keycap>CTRL</keycap><keycap>ALT</keycap><keycap>DEL</keycap></keycombo>, otherwise use your hardware's reset switch.</para>
<para>Try booting your normal kernel. If everything turns out fine, you
are ready to use the new library.</para>
</sect1>
</chapter>
<chapter id="troubleshooting">
<title>Troubleshooting&mdash;if something goes wrong... </title>
<para>If you come to this section and you have followed all the instructions
above, you probably encountered the problem of different
Linux distributions, some of which do not keep stuff where it should normally
be, but somewhere else. The Suse Linux distributions are most
famous for such stupid quirks, but there may be others having
similar problems. If you encounter such a thing and you find the
cause for the trouble&mdash;and hopefully a solution&mdash;please let me
know and I will add this to my HOWTO.</para>
<para>I think this section will never really be complete, but I
will list some possible errors and solutions for these issues.</para>
<sect1 id="errors-with-configure-or-make-while-trying-to-compile-the-glibc">
<title>Errors with <command>configure</command> or <command>make</command>
while trying to compile glibc</title>
<para>Sometimes you get configuration error telling you that, for example, a
requirement is not met&mdash;typical for software or other
library-packages which are to old. I encountered this with a series of
programs, especially during the compile of all the static
software. Normally there should be no problem: get an up-to-date
version of the software or libraries needed and then compile them
according to the description found in the source tree (usually
called <filename>README</filename>, <filename>INSTALL</filename> or
something similar).</para>
<para>But there are sometimes cases where this just does not want to work. For
example, I experienced problems compiling a new version of my
binutils (one of the reasons why I mention them in the
requirements), as I needed to compile glibc.
In return, the configure script for the binutils told me, <quote>Your
glibc is to old!</quote> So I thought, <emphasis>Here the snake starts eating
its tail</emphasis>. Thankfully there is a solution for this problem: if you
can not take one big step, try taking smaller ones, but more of them.</para>
<para>In my distribution, a glibc with the version number 2.1.1 was
included. To get around the error I tried to compile version
2.1.3, which was no problem. After I installed this version of the
library, I tried to compile the binutils once more, and this time
all the requirements were met.</para>
<para>If you encounter such a <quote>loop,</quote> try to find out what
version of the software required is the minimum, then download that version
(I think that is one of the reasons why so many old versions are
still lying around on the FTP servers). After successfully
compiling and installing, try to build the software that
complained about the version again; in most cases you should now be
able to compile. It may be necessary that you continue to use this method
to compile missing or old software.
This is what I call <quote>the long tail of the rat</quote> or
<quote>domino-effect.</quote> You only wanted to do one thing, but you needed
to do many more before you could make the move you wanted to. It
might be very nasty, but there is one good side to it: afterwards
you can be quite sure that many of the programs which were really
old will replaced by the time you finish your installation.
</para>
</sect1>
<sect1 id="something-goes-wrong-during-make-install">
<title>Something goes wrong during <command>make install</command></title>
<para>The most common mistake is not to have a set of basic, static tools;
in this case you can only use the command <command>cd</command>,
but nothing else. This is the reason why in this HOWTO I have described
in detail how to make those tools static.</para>
<para>The only tool not static is <command>mount</command> and, for good
reason in my opinion, it is included in the package of
linux-utils, which also contains <command>login</command>,
<command>passwd</command>, etc. Since you are
not able to use statically-linked versions in combination with PAM or
other security-related software, it would be unwise to
compile them statically under all circumstances. Of course you are free to do so if you are really sure about what you are doing.</para>
<sect2 id="going-back-to-a-working-configuration">
<title>Going back to a working configuration</title>
<para>The way back to a working configuration is quite simple if you
have the static tools: go to the directory
<filename>/usr/local/lib/</filename>
and move all the newly installed files into another location (eg.
<filename>/usr/local/lib/storedaway</filename>). You may identify them by
looking at their version number, which should be the same as the one from
your glibc installation (in my example all files fitted to
the scheme lib*-2.2.4), and of course by the creation date and
time. It is quite uncommon that two different libraries have the
same version number at the same time&mdash;I, myself, have never
experienced such a thing&mdash;but just to be sure you do not delete
something important to your system, check the date and
time of creation. A very useful tool in this case is the Midnight
Commander, if you have it installed.</para>
<para>You could try to remove the files <filename>ld-2.2.4.so</filename> and
<filename>libc-2.2.4.so</filename> and run <command>ldconfig -v</command> afterwards, before
removing all the crashed files. This will enable you to use at
least most of your programs and in every case you will be able
to run the Midnight Commander.</para>
<para>Do not forget to do at least one <command>ldconfig -v</command> after you have removed all the files.</para>
<sect3 id="removing-the-causes-for-the-crashing-of-the-installation">
<title>Removing the causes for the crashing of the installation</title>
<para>A common cause for problems is that your distribution has stored
all the library files in a different location than the newly-installed
routine will use, thus it often happens that there are two
versions running simultaneously, disturbing each other. In my case,
lots of trouble was caused by a second copy of <filename>libc6.so</filename>
lying around in <filename>/lib</filename>, a symbolic link from this file to
the corresponding one in <filename>/usr/local/lib</filename> fixes this problem.
</para>
</sect3>
</sect2>
</sect1>
</chapter>
</book>