How to Install GCC on Linux Fedora 16 Server

GCC is a powerful compiler used for compiling code written in various programming languages. It is essential for many development tasks on Linux servers. In this guide, we will show you how to install GCC on a Linux Fedora 16 server.

Step 1: Update the system

Before installing GCC, it is recommended to update the system to ensure that you have the latest packages and security updates. You can do this by running the following command as root:

yum update

This will update the system packages.

Step 2: Install GCC

After updating the system, you can install GCC by running the following command as root:

yum install gcc

This will download and install GCC and its dependencies.

[root@geek ~]# yum install gcc -y
Fedora16-Repository                                                                    | 3.7 kB     00:00 ...
Fedora16-Repository/primary_db                                                         | 2.3 MB     00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.i686 0:4.6.2-1.fc16 will be installed
--> Processing Dependency: cpp = 4.6.2-1.fc16 for package: gcc-4.6.2-1.fc16.i686
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.6.2-1.fc16.i686
--> Processing Dependency: binutils >= 2.20.51.0.2-12 for package: gcc-4.6.2-1.fc16.i686
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.6.2-1.fc16.i686
--> Processing Dependency: libmpfr.so.4 for package: gcc-4.6.2-1.fc16.i686
--> Processing Dependency: libmpc.so.2 for package: gcc-4.6.2-1.fc16.i686
--> Running transaction check
---> Package binutils.i686 0:2.21.53.0.1-2.fc16 will be installed
---> Package cloog-ppl.i686 0:0.15.9-3.fc15 will be installed
--> Processing Dependency: libppl.so.9 for package: cloog-ppl-0.15.9-3.fc15.i686
--> Processing Dependency: libppl_c.so.4 for package: cloog-ppl-0.15.9-3.fc15.i686
---> Package cpp.i686 0:4.6.2-1.fc16 will be installed
---> Package glibc-devel.i686 0:2.14.90-14 will be installed
--> Processing Dependency: glibc-headers = 2.14.90-14 for package: glibc-devel-2.14.90-14.i686
--> Processing Dependency: glibc-headers for package: glibc-devel-2.14.90-14.i686
---> Package libmpc.i686 0:0.9-1.fc16 will be installed
---> Package mpfr.i686 0:3.0.0-4.fc15 will be installed
--> Running transaction check
---> Package glibc-headers.i686 0:2.14.90-14 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.14.90-14.i686
--> Processing Dependency: kernel-headers for package: glibc-headers-2.14.90-14.i686
---> Package ppl.i686 0:0.11.2-3.fc16 will be installed
--> Processing Dependency: libpwl.so.5 for package: ppl-0.11.2-3.fc16.i686
--> Running transaction check
---> Package kernel-headers.i686 0:3.1.0-7.fc16 will be installed
---> Package ppl-pwl.i686 0:0.11.2-3.fc16 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                   Arch            Version                       Repository                      Size
==============================================================================================================
Installing:
 gcc                       i686            4.6.2-1.fc16                  Fedora16-Repository             11 M
Installing for dependencies:
 binutils                  i686            2.21.53.0.1-2.fc16            Fedora16-Repository            3.5 M
 cloog-ppl                 i686            0.15.9-3.fc15                 Fedora16-Repository             93 k
 cpp                       i686            4.6.2-1.fc16                  Fedora16-Repository            3.9 M
 glibc-devel               i686            2.14.90-14                    Fedora16-Repository            983 k
 glibc-headers             i686            2.14.90-14                    Fedora16-Repository            612 k
 kernel-headers            i686            3.1.0-7.fc16                  Fedora16-Repository            768 k
 libmpc                    i686            0.9-1.fc16                    Fedora16-Repository             49 k
 mpfr                      i686            3.0.0-4.fc15                  Fedora16-Repository            167 k
 ppl                       i686            0.11.2-3.fc16                 Fedora16-Repository            1.4 M
 ppl-pwl                   i686            0.11.2-3.fc16                 Fedora16-Repository             35 k

Transaction Summary
==============================================================================================================
Install      11 Packages

Total download size: 23 M
Installed size: 61 M
Downloading Packages:
--------------------------------------------------------------------------------------------------------------
Total                                                                          20 MB/s |  23 MB     00:01
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-headers-3.1.0-7.fc16.i686                                                          1/11
  Installing : mpfr-3.0.0-4.fc15.i686                                                                    2/11
  Installing : glibc-headers-2.14.90-14.i686                                                             3/11
  Installing : libmpc-0.9-1.fc16.i686                                                                    4/11
  Installing : glibc-devel-2.14.90-14.i686                                                               5/11
  Installing : cpp-4.6.2-1.fc16.i686                                                                     6/11
  Installing : ppl-pwl-0.11.2-3.fc16.i686                                                                7/11
  Installing : ppl-0.11.2-3.fc16.i686                                                                    8/11
  Installing : cloog-ppl-0.15.9-3.fc15.i686                                                              9/11
  Installing : binutils-2.21.53.0.1-2.fc16.i686                                                         10/11
  Installing : gcc-4.6.2-1.fc16.i686                                                                    11/11

Installed:
  gcc.i686 0:4.6.2-1.fc16

Dependency Installed:
  binutils.i686 0:2.21.53.0.1-2.fc16   cloog-ppl.i686 0:0.15.9-3.fc15    cpp.i686 0:4.6.2-1.fc16
  glibc-devel.i686 0:2.14.90-14        glibc-headers.i686 0:2.14.90-14   kernel-headers.i686 0:3.1.0-7.fc16
  libmpc.i686 0:0.9-1.fc16             mpfr.i686 0:3.0.0-4.fc15          ppl.i686 0:0.11.2-3.fc16
  ppl-pwl.i686 0:0.11.2-3.fc16

Complete!

Step 3: Verify GCC installation

After installing GCC, you can verify that it is installed correctly by running the following command:

gcc --version

This will display the GCC version and other information about the GCC installation.

See also  How to Install Subversion 1.6.17 on Fedora 16

Step 4: Install GCC documentation

If you want to access the GCC documentation, you can install it by running the following command as root:

yum install gcc-doc

This will install the GCC documentation in /usr/share/doc/gcc-/ directory.

Step 5: Install GCC C++ support

If you need to compile C++ code, you also need to install the GCC C++ support. You can do this by running the following command as root:

yum install gcc-c++

This will install the GCC C++ support and its dependencies.

See also  How to Search for Available PHP5 Modules on Fedora 16

Commands Mentioned:

  • yum update – updates the system packages
  • yum install – installs packages
  • gcc –version – displays GCC version information
  • yum install gcc-doc – installs GCC documentation
  • yum install gcc-c++ – installs GCC C++ support

Conclusion:

In this guide, we have shown you how to install GCC on a Linux Fedora 16 server. By installing GCC, you can compile code written in various programming languages. Remember to update the system before installing GCC and to verify the GCC installation after installation. Additionally, if you need to compile C++ code, you also need to install the GCC C++ support.

Comments

3 Comments

Leave a Reply to Felipe Cancel reply

Your email address will not be published. Required fields are marked *