Linux(CentOS 6) - yum installコマンドでgccパッケージをインストールする

C言語のソースファイルをコンパイルするために、gccコマンドを実行すると、

gcc: コマンドが見つかりません

というエラーメッセージが表示された。

CentOS 6.4のミニマルインストールではgccコマンドはインストールされないようだ。

以下は、gccコマンドをyum installでインストールした時のメモ。

[root@test test]# gcc test.c ← test.cというファイル名のC言語のソースファイルをコンパイルするためにgccコマンドを実行
-bash: gcc: コマンドが見つかりません ← gccコマンドがインストールされていないと、このようなエラーメッセージが表示される。
[root@test test]# yum install gcc ← yum installコマンドで、gccをインストール
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
base                                                     | 3.7 kB     00:00
base/primary_db                                          | 4.4 MB     00:01
extras                                                   | 3.4 kB     00:00
extras/primary_db                                        |  19 kB     00:00
updates                                                  | 3.4 kB     00:00
updates/primary_db                                       | 3.1 MB     00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libgomp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x8                                                                                        6_64
--> Processing Dependency: cpp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: libgcc >= 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x8                                                                                        6_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-4.el6                                                                                        .x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-4.el6.x8                                                                                        6_64
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-                                                                                        1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.                                                                                        2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-4.el6.x8                                                                                        6_64
---> Package glibc-devel.x86_64 0:2.12-1.132.el6_5.1 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.132.el6_5.1 for package: glibc                                                                                        -devel-2.12-1.132.el6_5.1.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6_5.1 for package: glibc-devel-2                                                                                        .12-1.132.el6_5.1.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.132.el6                                                                                        _5.1.x86_64
---> Package libgcc.x86_64 0:4.4.7-3.el6 will be updated
---> Package libgcc.x86_64 0:4.4.7-4.el6 will be an update
---> Package libgomp.x86_64 0:4.4.7-4.el6 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.12-1.107.el6 will be updated
--> Processing Dependency: glibc = 2.12-1.107.el6 for package: glibc-common-2.12                                                                                        -1.107.el6.x86_64
---> Package glibc.x86_64 0:2.12-1.132.el6_5.1 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.132.el6_5.1 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.                                                                                        12-1.132.el6_5.1.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.132.                                                                                        el6_5.1.x86_64
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.107.el6 will be updated
---> Package glibc-common.x86_64 0:2.12-1.132.el6_5.1 will be an update
---> Package kernel-headers.x86_64 0:2.6.32-431.17.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch        Version                     Repository    Size
================================================================================
Installing:
 gcc                 x86_64      4.4.7-4.el6                 base          10 M
Installing for dependencies:
 cloog-ppl           x86_64      0.15.7-1.2.el6              base          93 k
 cpp                 x86_64      4.4.7-4.el6                 base         3.7 M
 glibc-devel         x86_64      2.12-1.132.el6_5.1          updates      978 k
 glibc-headers       x86_64      2.12-1.132.el6_5.1          updates      608 k
 kernel-headers      x86_64      2.6.32-431.17.1.el6         updates      2.9 M
 libgomp             x86_64      4.4.7-4.el6                 base         118 k
 mpfr                x86_64      2.4.1-6.el6                 base         157 k
 ppl                 x86_64      0.10.2-11.el6               base         1.3 M
Updating for dependencies:
 glibc               x86_64      2.12-1.132.el6_5.1          updates      3.8 M
 glibc-common        x86_64      2.12-1.132.el6_5.1          updates       14 M
 libgcc              x86_64      4.4.7-4.el6                 base         101 k

Transaction Summary
================================================================================
Install       9 Package(s)
Upgrade       3 Package(s)

Total download size: 38 M
Is this ok [y/N]: y
Downloading Packages:
(1/12): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm              |  93 kB     00:00
(2/12): cpp-4.4.7-4.el6.x86_64.rpm                       | 3.7 MB     00:00
(3/12): gcc-4.4.7-4.el6.x86_64.rpm                       |  10 MB     00:03
(4/12): glibc-2.12-1.132.el6_5.1.x86_64.rpm              | 3.8 MB     00:00
(5/12): glibc-common-2.12-1.132.el6_5.1.x86_64.rpm       |  14 MB     00:03
(6/12): glibc-devel-2.12-1.132.el6_5.1.x86_64.rpm        | 978 kB     00:00
(7/12): glibc-headers-2.12-1.132.el6_5.1.x86_64.rpm      | 608 kB     00:00
(8/12): kernel-headers-2.6.32-431.17.1.el6.x86_64.rpm    | 2.9 MB     00:00
(9/12): libgcc-4.4.7-4.el6.x86_64.rpm                    | 101 kB     00:00
(10/12): libgomp-4.4.7-4.el6.x86_64.rpm                  | 118 kB     00:00
(11/12): mpfr-2.4.1-6.el6.x86_64.rpm                     | 157 kB     00:00
(12/12): ppl-0.10.2-11.el6.x86_64.rpm                    | 1.3 MB     00:00
--------------------------------------------------------------------------------
Total                                           3.4 MB/s |  38 MB     00:11
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : libgcc-4.4.7-4.el6.x86_64                                   1/15
  Updating   : glibc-common-2.12-1.132.el6_5.1.x86_64                      2/15
  Updating   : glibc-2.12-1.132.el6_5.1.x86_64                             3/15
  Installing : libgomp-4.4.7-4.el6.x86_64                                  4/15
  Installing : mpfr-2.4.1-6.el6.x86_64                                     5/15
  Installing : cpp-4.4.7-4.el6.x86_64                                      6/15
  Installing : ppl-0.10.2-11.el6.x86_64                                    7/15
  Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                             8/15
  Installing : kernel-headers-2.6.32-431.17.1.el6.x86_64                   9/15
  Installing : glibc-headers-2.12-1.132.el6_5.1.x86_64                    10/15
  Installing : glibc-devel-2.12-1.132.el6_5.1.x86_64                      11/15
  Installing : gcc-4.4.7-4.el6.x86_64                                     12/15
  Cleanup    : glibc-common-2.12-1.107.el6.x86_64                         13/15
  Cleanup    : glibc-2.12-1.107.el6.x86_64                                14/15
  Cleanup    : libgcc-4.4.7-3.el6.x86_64                                  15/15
  Verifying  : glibc-2.12-1.132.el6_5.1.x86_64                             1/15
  Verifying  : kernel-headers-2.6.32-431.17.1.el6.x86_64                   2/15
  Verifying  : cpp-4.4.7-4.el6.x86_64                                      3/15
  Verifying  : glibc-headers-2.12-1.132.el6_5.1.x86_64                     4/15
  Verifying  : libgomp-4.4.7-4.el6.x86_64                                  5/15
  Verifying  : mpfr-2.4.1-6.el6.x86_64                                     6/15
  Verifying  : glibc-devel-2.12-1.132.el6_5.1.x86_64                       7/15
  Verifying  : libgcc-4.4.7-4.el6.x86_64                                   8/15
  Verifying  : glibc-common-2.12-1.132.el6_5.1.x86_64                      9/15
  Verifying  : gcc-4.4.7-4.el6.x86_64                                     10/15
  Verifying  : ppl-0.10.2-11.el6.x86_64                                   11/15
  Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                            12/15
  Verifying  : glibc-2.12-1.107.el6.x86_64                                13/15
  Verifying  : libgcc-4.4.7-3.el6.x86_64                                  14/15
  Verifying  : glibc-common-2.12-1.107.el6.x86_64                         15/15

Installed:
  gcc.x86_64 0:4.4.7-4.el6

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6
  cpp.x86_64 0:4.4.7-4.el6
  glibc-devel.x86_64 0:2.12-1.132.el6_5.1
  glibc-headers.x86_64 0:2.12-1.132.el6_5.1
  kernel-headers.x86_64 0:2.6.32-431.17.1.el6
  libgomp.x86_64 0:4.4.7-4.el6
  mpfr.x86_64 0:2.4.1-6.el6
  ppl.x86_64 0:0.10.2-11.el6

Dependency Updated:
  glibc.x86_64 0:2.12-1.132.el6_5.1   glibc-common.x86_64 0:2.12-1.132.el6_5.1
  libgcc.x86_64 0:4.4.7-4.el6

Complete! ← gccコマンドのインストール完了。これで、gccコマンドを使って、C言語のソースファイルをコンパイルできるようになる。

前へ

Excel 2010で空白セルを自動的に着色する方法

次へ

C言語のコンパイルエラー「undeclared (first use in this function)」の原因