Installing and Uninstalling the GNU Tools under Linux
This document shows you how to install and uninstall the precompiled GNU Tools for the ARM
microcontroller under the Linux operating system.
In this document, “$
” will indicate the
ordinary user’s shell prompt, and “#
” will
indicate the root superuser’s shell prompt. Anything in a bold
monospaced font is what you are expected to type in; an
ordinary monospaced font is used for the computer’s
response. Please note that this document doesn’t always show
every response from the computer!
Minimum System Requirements
In order to successfully install and run the GNU Tools, you will need
to meet at least the following requirements:
1. |
A relatively modern Linux system with kernel version 2.0 or later,
with the GNU C Library version 2.2.3 or later, and with XFree 3.3 or later
as the graphical interface. |
|
Any modern Linux distribution (anything later than about
2000), such as Debian GNU/Linux 3.0
or Red Hat Linux 7.2, will satisfy
these requirements. Of course, later versions will, as well… If you
wish to be certain, however, you can check for yourself: |
|
|
a) |
You can determine the operating system version by running
uname -r. Anything later than version 2.0 is OK (eg, 2.2.19 or
2.4.17). For those technically inclined, the only requirement that the
Linux kernel must satisfy is the ability to run ELF binaries. |
b) |
All modern Linux systems will most definitely be running
version 2 of the GNU C Library. If you need to be certain, you can check
by typing ls -l /lib/libc.so.6; this should be a symbolic link
to libc. version.so , where
version is the version number; this should be
2.x.y for some values of x and
y. The complete version number needs to be 2.2.3 or later. If
you get the error message “No such file or directory”, or if
your library version number is less than 2.2.3, you will need to install
the GNU Tools from source. |
c) |
You can check the version of XFree86 that you are running by
typing X -version. This should be 3.3.x for some
value of x, or 4.x.y for some values of
x and y. Please note that you may need to run this
command as the root superuser, depending on your system. |
|
|
2. |
At least 110 MB of free disk space. |
|
The df command will give you this information.
If your system is correctly set up, man df will give you some
documentation on how to run this command and how to interpret its results.
Remember that the man (manual page) command is your
friend! |
|
3. |
The password for the root superuser’s account on your
system. |
Installation Instructions
Installing the GNU Tools is quite simple, but be careful that you type
in the commands exactly as shown! These instructions assume that you have
already mounted the CD-ROM on your computer, and that the mount
point (where the CD-ROM can be found within the file system) is /mnt/cdrom. See the instructions for mounting the
CD-ROM for more details.
1. |
Log in as an ordinary user, not as the root superuser. This is
highly recommended and is standard Unix practice. In fact, you should
never directly log in as the root superuser; this helps save you
from your own mistakes and/or any viruses that can destroy the working of
your system! |
2. |
Check that your path contains /usr/local/bin: |
|
$ echo $PATH |
/usr/local/bin:/bin:/usr/bin:/usr/bin/X11 |
|
|
The response on your system might be different — that is OK
as long as it contains /usr/local/bin. If it does
not, you will need to read your system manuals to determine which file you
need to modify (usually /etc/profile) and how to
do so. |
3. |
Become the root superuser (you will need the superuser’s
password here) and change to the root directory: |
|
|
4. |
Unpack the GNU Tools archive: |
|
# | tar xzvf /mnt/cdrom/gnutools/linux/arm-elf-gnutools-linux-i386-2003-06.tar.gz |
|
|
By the way, the cautious (ie, good) system administrator
will check the contents of this archive before installing it! To
do this, use tzvf instead of xzvf in the above
command. |
5. |
Exit the root superuser’s shell: |
|
|
6. |
You have successfully installed the GNU Tools under Linux! |
Uninstallation Instructions
Removing the precompiled GNU Tools from your system is as easy as
installing them. These instructions assume that you have the CD-ROM
mounted on /mnt/cdrom before you begin.
1. |
Log in as an ordinary user, not as the root superuser. Once
again, this is highly recommended for security reasons. |
2. |
Become the root superuser and change to the root directory: |
|
|
3. |
Execute the uninstall script: |
|
# | /mnt/cdrom/gnutools/linux/arm-elf-gnutools-linux-i386-2003-06.uninstall |
|
|
By the way, any system administrator worth his or her salt will
check the contents of this uninstall script before running it!
You wouldn’t open an executable attachment sent to you in
an e-mail, now, would you? |
4. |
Exit the root superuser’s shell: |
|
|
5. |
You have successfully uninstalled the GNU Tools from your
system. |
Common Problems
In most cases, you will not encounter any problems in installing the
GNU Tools. There might be exceptions, however. You should check the
following if any step terminates with an error:
• |
Check that you entered all commands exactly as specified.
Please note that your browser may split up commands over a number of lines
(depending on the width of your browser window); that does not mean you do
the same! Each shell prompt (“$ ” or
“# ”) indicates a single command
line. |
If your efforts at installing the GNU Tools fail, please consult your
lecturer or another suitably competent person. Good luck!