关闭

Linux中安装gcc

标签: linuxgcc
145人阅读 评论(0) 收藏 举报
分类:

如何在Linux系统中安装gcc

身为菜鸟的我,最近准备复习一遍C语言,之前都是在VS上运行C程序的,现在想在linux环境下进行编程联系。众所周知,gcc是C语言最原始的编译器。所以,安装gcc是必要的。

我是在虚拟机上运行Linux的,先说说我的简单配置:用的是CentOS5.3 64位的系统,内核版本号为2.6.18-128.el5,该Linux系统没有预装gcc,我们可以用yum命令来安装gcc。

安装命令

yum install gcc

安装过程如下

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.opencas.cn
 * updates: mirrors.opencas.cn
 * addons: mirrors.btte.net
 * extras: mirrors.opencas.cn
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
--> Processing Dependency: gcc = 4.1.2-44.el5 for package: gcc-gfortran
--> Processing Dependency: gcc = 4.1.2-44.el5 for package: gcc-c++
---> Package gcc.x86_64 0:4.1.2-55.el5 set to be updated
--> Processing Dependency: cpp = 4.1.2-55.el5 for package: gcc
--> Processing Dependency: libgcc >= 4.1.2-55.el5 for package: gcc
--> Running transaction check
---> Package cpp.x86_64 0:4.1.2-55.el5 set to be updated
---> Package libgcc.x86_64 0:4.1.2-55.el5 set to be updated
---> Package libgcc.i386 0:4.1.2-55.el5 set to be updated
---> Package gcc-c++.x86_64 0:4.1.2-55.el5 set to be updated
--> Processing Dependency: libstdc++-devel = 4.1.2-55.el5 for package: gcc-c++
--> Processing Dependency: libstdc++ = 4.1.2-55.el5 for package: gcc-c++
---> Package gcc-gfortran.x86_64 0:4.1.2-55.el5 set to be updated
--> Processing Dependency: libgfortran = 4.1.2-55.el5 for package: gcc-gfortran
--> Running transaction check
---> Package libstdc++-devel.x86_64 0:4.1.2-55.el5 set to be updated
---> Package libstdc++.x86_64 0:4.1.2-55.el5 set to be updated
---> Package libstdc++.i386 0:4.1.2-55.el5 set to be updated
---> Package libgfortran.x86_64 0:4.1.2-55.el5 set to be updated
filelists.xml.gz                                         | 3.7 MB     00:22     


filelists.sqlite.bz2                                     | 2.4 MB     00:19     
filelists.sqlite.bz2                                     | 224 kB     00:03     
filelists.sqlite.bz2                                     |  570 B     00:00     
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                 Arch           Version              Repository    Size
================================================================================
Updating:
 cpp                     x86_64         4.1.2-55.el5         base         2.9 M
 gcc                     x86_64         4.1.2-55.el5         base         5.3 M
 gcc-c++                 x86_64         4.1.2-55.el5         base         3.8 M
 gcc-gfortran            x86_64         4.1.2-55.el5         base         3.5 M
 libgcc                  i386           4.1.2-55.el5         base          97 k
 libgcc                  x86_64         4.1.2-55.el5         base         100 k
 libgfortran             x86_64         4.1.2-55.el5         base         245 k
 libstdc++               x86_64         4.1.2-55.el5         base         354 k
 libstdc++               i386           4.1.2-55.el5         base         364 k
 libstdc++-devel         x86_64         4.1.2-55.el5         base         2.8 M

Transaction Summary
================================================================================
Install      0 Package(s)         
Update      10 Package(s)         
Remove       0 Package(s)         

Total download size: 19 M
Is this ok [y/N]: Exiting on user Command
Complete!
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:4389次
    • 积分:108
    • 等级:
    • 排名:千里之外
    • 原创:6篇
    • 转载:1篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档