linuxでYUMを使用してGCC、gcc-c++をインストール


サーバーをインストールする时に図は速くいくつかのシステムのソフトウェアをインストールしていないで、结果は后でC++を使って环境をコンパイルする必要があって、システム自身がCコンパイルの环境がないため、ソースコードをダウンロードしてインストールすることができなくて、rpmファイルをダウンロードしてインストールするしかなくて、しかしrpmを使ってインストールする时、多くの依存のインストールパッケージがあって、またシステムがネットに接続することができることを考虑してYUMを使ってGCCをインストール
        まずYUMの原理を話しましょう:CentOSは先に発表したソフトウェアをYUMサーバー内に置いて、それからこれらのソフトウェアの依存する属性を分析して、ソフトウェア内の記録の情報を書きます.これらの情報を分析して、ソフトウェア関連性のリストに記録します.クライアントにソフトウェアのインストールの必要性がある場合、クライアントホストは、ネットワーク上のyumサーバからインストールするソフトウェアと関連する依存性属性のソフトウェアのダウンロードを自発的に要求します.
     この2つのハイエンドの大気レベルに直接上がった言葉をたくさん話しましょう.
 yum -y install gcc yum -y install gcc-c++
次の図は、インストールの手順を示しています.
[root@localhost ~]# yum -y install gcc
Loaded plugins: fastestmirror, rhnplugin, security
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
This system is not registered with RHN.
RHN support will be disabled.
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.i386 0:4.1.2-51.el5 set to be updated
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc
--> Running transaction check
---> Package glibc-devel.i386 0:2.5-65 set to be updated
--> Processing Dependency: glibc-headers = 2.5-65 for package: glibc-devel
--> Processing Dependency: glibc-headers for package: glibc-devel
--> Running transaction check
---> Package glibc-headers.i386 0:2.5-65 set to be updated
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers
--> Processing Dependency: kernel-headers for package: glibc-headers
--> Running transaction check
---> Package kernel-headers.i386 0:2.6.18-274.3.1.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch       Version                    Repository     Size
================================================================================
Installing:
 gcc                  i386       4.1.2-51.el5               base          5.2 M
Installing for dependencies:
 glibc-devel          i386       2.5-65                     base          2.0 M
 glibc-headers        i386       2.5-65                     base          604 k
 kernel-headers       i386       2.6.18-274.3.1.el5         updates       1.2 M

Transaction Summary
================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 9.1 M
Downloading Packages:
(1/4): glibc-headers-2.5-65.i386.rpm                     | 604 kB     00:06     
(2/4): kernel-headers-2.6.18-274.3.1.el5.i386.rpm        | 1.2 MB     00:14     
(3/4): glibc-devel-2.5-65.i386.rpm                       | 2.0 MB     00:11     
(4/4): gcc-4.1.2-51.el5.i386.rpm                         | 5.2 MB     00:27     
--------------------------------------------------------------------------------
Total                                           149 kB/s | 9.1 MB     01:02     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : kernel-headers                                           1/4 
  Installing     : glibc-headers                                            2/4 
  Installing     : glibc-devel                                              3/4 
  Installing     : gcc                                                      4/4 

Installed:
  gcc.i386 0:4.1.2-51.el5                                                       

Dependency Installed:
  glibc-devel.i386 0:2.5-65                     glibc-headers.i386 0:2.5-65     
  kernel-headers.i386 0:2.6.18-274.3.1.el5     

Complete!
[root@localhost ~]#