gccのインストール手順(CentOS 7.3構築メモ)

本記事ではCentOS 7.3でgccをインストールする手順を紹介します。

 

OSバージョン確認

$ cat /etc/redhat-release

CentOS Linux release 7.3.1611 (Core)

 

gccがインストールされていないことの確認

$ gcc

-bash: gcc: command not found

 

$ rpm -qa gcc

出力なし

 

yumを使ったgccのインストール

$sudo yum -y install gcc

base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 156 kB 00:00:00
(2/4): extras/7/x86_64/primary_db | 128 kB 00:00:00
(3/4): updates/7/x86_64/primary_db | 3.6 MB 00:00:01
(4/4): base/7/x86_64/primary_db | 5.7 MB 00:00:01
Resolving Dependencies
–> Running transaction check
—> Package gcc.x86_64 0:4.8.5-16.el7 will be installed
–> Processing Dependency: libgomp = 4.8.5-16.el7 for package: gcc-4.8.5-16.el7.x86_64
–> Processing Dependency: cpp = 4.8.5-16.el7 for package: gcc-4.8.5-16.el7.x86_64
–> Processing Dependency: libgcc >= 4.8.5-16.el7 for package: gcc-4.8.5-16.el7.x86_64
–> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-16.el7.x86_64
–> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-16.el7.x86_64
–> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-16.el7.x86_64
–> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.8.5-16.el7.x86_64
–> Running transaction check
—> Package cpp.x86_64 0:4.8.5-16.el7 will be installed
—> Package glibc-devel.x86_64 0:2.17-196.el7 will be installed
–> Processing Dependency: glibc-headers = 2.17-196.el7 for package: glibc-devel-2.17-196.el7.x86_64
–> Processing Dependency: glibc = 2.17-196.el7 for package: glibc-devel-2.17-196.el7.x86_64
–> Processing Dependency: glibc-headers for package: glibc-devel-2.17-196.el7.x86_64
—> Package libgcc.x86_64 0:4.8.5-11.el7 will be updated
—> Package libgcc.x86_64 0:4.8.5-16.el7 will be an update
—> Package libgomp.x86_64 0:4.8.5-16.el7 will be installed
—> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
—> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
–> Running transaction check
—> Package glibc.x86_64 0:2.17-157.el7_3.2 will be updated
–> Processing Dependency: glibc = 2.17-157.el7_3.2 for package: nscd-2.17-157.el7_3.2.x86_64
–> Processing Dependency: glibc = 2.17-157.el7_3.2 for package: glibc-common-2.17-157.el7_3.2.x86_64
—> Package glibc.x86_64 0:2.17-196.el7 will be an update
—> Package glibc-headers.x86_64 0:2.17-196.el7 will be installed
–> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-196.el7.x86_64
–> Processing Dependency: kernel-headers for package: glibc-headers-2.17-196.el7.x86_64
–> Running transaction check
—> Package glibc-common.x86_64 0:2.17-157.el7_3.2 will be updated
—> Package glibc-common.x86_64 0:2.17-196.el7 will be an update
—> Package kernel-headers.x86_64 0:3.10.0-693.5.2.el7 will be installed
—> Package nscd.x86_64 0:2.17-157.el7_3.2 will be updated
—> Package nscd.x86_64 0:2.17-196.el7 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================
Installing:
gcc x86_64 4.8.5-16.el7 base 16 M
Installing for dependencies:
cpp x86_64 4.8.5-16.el7 base 5.9 M
glibc-devel x86_64 2.17-196.el7 base 1.1 M
glibc-headers x86_64 2.17-196.el7 base 675 k
kernel-headers x86_64 3.10.0-693.5.2.el7 updates 6.0 M
libgomp x86_64 4.8.5-16.el7 base 154 k
libmpc x86_64 1.0.1-3.el7 base 51 k
mpfr x86_64 3.1.1-4.el7 base 203 k
Updating for dependencies:
glibc x86_64 2.17-196.el7 base 3.6 M
glibc-common x86_64 2.17-196.el7 base 11 M
libgcc x86_64 4.8.5-16.el7 base 98 k
nscd x86_64 2.17-196.el7 base 273 k

Transaction Summary
============================================================================================================================================
Install 1 Package (+7 Dependent packages)
Upgrade ( 4 Dependent packages)

Total download size: 46 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/12): cpp-4.8.5-16.el7.x86_64.rpm | 5.9 MB 00:00:01
(2/12): glibc-2.17-196.el7.x86_64.rpm | 3.6 MB 00:00:00
(3/12): gcc-4.8.5-16.el7.x86_64.rpm | 16 MB 00:00:03
(4/12): glibc-devel-2.17-196.el7.x86_64.rpm | 1.1 MB 00:00:00
(5/12): libgcc-4.8.5-16.el7.x86_64.rpm | 98 kB 00:00:00
(6/12): glibc-headers-2.17-196.el7.x86_64.rpm | 675 kB 00:00:00
(7/12): libgomp-4.8.5-16.el7.x86_64.rpm | 154 kB 00:00:00
(8/12): libmpc-1.0.1-3.el7.x86_64.rpm | 51 kB 00:00:00
(9/12): mpfr-3.1.1-4.el7.x86_64.rpm | 203 kB 00:00:00
(10/12): nscd-2.17-196.el7.x86_64.rpm | 273 kB 00:00:00
(11/12): kernel-headers-3.10.0-693.5.2.el7.x86_64.rpm | 6.0 MB 00:00:01
(12/12): glibc-common-2.17-196.el7.x86_64.rpm | 11 MB 00:00:02
——————————————————————————————————————————————–
Total 9.3 MB/s | 46 MB 00:00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libgcc-4.8.5-16.el7.x86_64 1/16
Updating : glibc-common-2.17-196.el7.x86_64 2/16
Updating : glibc-2.17-196.el7.x86_64 3/16
warning: /etc/nsswitch.conf created as /etc/nsswitch.conf.rpmnew
Installing : mpfr-3.1.1-4.el7.x86_64 4/16
Installing : libmpc-1.0.1-3.el7.x86_64 5/16
Installing : cpp-4.8.5-16.el7.x86_64 6/16
Installing : libgomp-4.8.5-16.el7.x86_64 7/16
Installing : kernel-headers-3.10.0-693.5.2.el7.x86_64 8/16
Installing : glibc-headers-2.17-196.el7.x86_64 9/16
Installing : glibc-devel-2.17-196.el7.x86_64 10/16
Installing : gcc-4.8.5-16.el7.x86_64 11/16
Updating : nscd-2.17-196.el7.x86_64 12/16
Cleanup : nscd-2.17-157.el7_3.2.x86_64 13/16
Cleanup : glibc-2.17-157.el7_3.2.x86_64 14/16
Cleanup : glibc-common-2.17-157.el7_3.2.x86_64 15/16
Cleanup : libgcc-4.8.5-11.el7.x86_64 16/16
Verifying : libgcc-4.8.5-16.el7.x86_64 1/16
Verifying : glibc-common-2.17-196.el7.x86_64 2/16
Verifying : mpfr-3.1.1-4.el7.x86_64 3/16
Verifying : kernel-headers-3.10.0-693.5.2.el7.x86_64 4/16
Verifying : libgomp-4.8.5-16.el7.x86_64 5/16
Verifying : cpp-4.8.5-16.el7.x86_64 6/16
Verifying : gcc-4.8.5-16.el7.x86_64 7/16
Verifying : glibc-headers-2.17-196.el7.x86_64 8/16
Verifying : glibc-devel-2.17-196.el7.x86_64 9/16
Verifying : glibc-2.17-196.el7.x86_64 10/16
Verifying : nscd-2.17-196.el7.x86_64 11/16
Verifying : libmpc-1.0.1-3.el7.x86_64 12/16
Verifying : glibc-2.17-157.el7_3.2.x86_64 13/16
Verifying : nscd-2.17-157.el7_3.2.x86_64 14/16
Verifying : glibc-common-2.17-157.el7_3.2.x86_64 15/16
Verifying : libgcc-4.8.5-11.el7.x86_64 16/16

Installed:
gcc.x86_64 0:4.8.5-16.el7

Dependency Installed:
cpp.x86_64 0:4.8.5-16.el7 glibc-devel.x86_64 0:2.17-196.el7 glibc-headers.x86_64 0:2.17-196.el7
kernel-headers.x86_64 0:3.10.0-693.5.2.el7 libgomp.x86_64 0:4.8.5-16.el7 libmpc.x86_64 0:1.0.1-3.el7
mpfr.x86_64 0:3.1.1-4.el7

Dependency Updated:
glibc.x86_64 0:2.17-196.el7 glibc-common.x86_64 0:2.17-196.el7 libgcc.x86_64 0:4.8.5-16.el7 nscd.x86_64 0:2.17-196.el7

Complete!

 

インストール結果確認

$ rpm -qa gcc

gcc-4.8.5-16.el7.x86_64

 

上記が表示されればインストールは正常に完了。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です