如果服务器是自己的,并且机器就在身边,那什么都不用说了,缺少gcc顶多就是重新放入安装盘,把开发工具包安装上。但是如果是租的服务器,托管服务 方那帮人又搞不懂你说的啥子gcc,要安装gcc实在是太麻烦了。你得去找gcc相关的包,版本号还得必须对应上,否则不兼容。最近给一个朋友装gcc, 着实头疼了一把。后来发现yum这个好东西,只需要执行一个命令,所有的烦恼都解除了。

朋友的系统是CentOS 5 的,托管商没给安装gcc,于是使用如下两个命令就可把gcc,gcc-c++统统安装上:

yum -y install gcc

yum -y install gcc-c++

yum会自动查找软件的相关依赖包,自动下载安装,全过程轻松愉快。特此记录一下。

[root@localhost Jorcen]# yum -y install gcc
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
livna | 1.3 kB :
rpmfusion-free-updates | 3.3 kB :
rpmfusion-nonfree-updates | 3.3 kB :
updates//x86_64/metalink | 4.0 kB :
updates | 4.9 kB :
updates//x86_64/primary_db | MB :
(/): rpmfusion-nonfree-updates//x86_64/primary_db | kB :
(/): updates//x86_64/updateinfo | 1.2 MB :
(/): updates//x86_64/pkgtags | 1.0 MB :
Loading mirror speeds from cached hostfile
* fedora: mirrors.oschina.net
* livna: ftp-stud.fht-esslingen.de
* rpmfusion-free: mirror.bjtu.edu.cn
* rpmfusion-free-updates: mirror.bjtu.edu.cn
* rpmfusion-nonfree: mirror.bjtu.edu.cn
* rpmfusion-nonfree-updates: mirror.bjtu.edu.cn
* updates: mirrors.oschina.net
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 :4.8.-.fc19 will be installed
--> Processing Dependency: cpp = 4.8.-.fc19 for package: gcc-4.8.-.fc19.x86_64
--> Processing Dependency: glibc-devel >= 2.2.- for package: gcc-4.8.-.fc19.x86_64
--> Processing Dependency: libmpc.so.()(64bit) for package: gcc-4.8.-.fc19.x86_64
--> Running transaction check
---> Package cpp.x86_64 :4.8.-.fc19 will be installed
---> Package glibc-devel.x86_64 :2.17-.fc19 will be installed
--> Processing Dependency: glibc-headers = 2.17-.fc19 for package: glibc-devel-2.17-.fc19.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-.fc19.x86_64
---> Package libmpc.x86_64 :1.0.-.fc19 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 :2.17-.fc19 will be installed
--> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Installing:
gcc x86_64 4.8.-.fc19 updates M
Installing for dependencies:
cpp x86_64 4.8.-.fc19 updates 5.9 M
glibc-devel x86_64 2.17-.fc19 updates 1.0 M
glibc-headers x86_64 2.17-.fc19 updates k
libmpc x86_64 1.0.-.fc19 fedora k Transaction Summary
======================================================================================================================================================
Install Package (+ Dependent packages) Total download size: M
Installed size: M
Downloading packages:
cpp-4.8.-.fc19.x86_64.rpm FAILED ] kB/s | kB :: ETA
http://mirror.nus.edu.sg/fedora/linux/updates/19/x86_64/cpp-4.8.2-7.fc19.x86_64.rpm: [Errno 14] HTTP Error 403 - ForbiddenkB/s | 251 kB 00:09:16 ETA
Trying other mirror.
glibc-headers-2.17-.fc19.x86 FAILED ] kB/s | kB :: ETA
http://mirror.nus.edu.sg/fedora/linux/updates/19/x86_64/glibc-headers-2.17-20.fc19.x86_64.rpm: [Errno 14] HTTP Error 403 - Forbidden kB 00:08:02 ETA
Trying other mirror.
(/): libmpc-1.0.-.fc19.x86_64.rpm | kB ::
(/): glibc-devel-2.17-.fc19.x86_64.rpm | 1.0 MB ::
(/): cpp-4.8.-.fc19.x86_64.rpm | 5.9 MB ::
(/): glibc-headers-2.17-.fc19.x86_64.rpm | kB ::
(/): gcc-4.8.-.fc19.x86_64.rpm | MB ::
------------------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libmpc-1.0.-.fc19.x86_64 /
Installing : cpp-4.8.-.fc19.x86_64 /
Installing : glibc-headers-2.17-.fc19.x86_64 /
Installing : glibc-devel-2.17-.fc19.x86_64 /
Installing : gcc-4.8.-.fc19.x86_64 /
Verifying : cpp-4.8.-.fc19.x86_64 /
Verifying : glibc-headers-2.17-.fc19.x86_64 /
Verifying : glibc-devel-2.17-.fc19.x86_64 /
Verifying : gcc-4.8.-.fc19.x86_64 /
Verifying : libmpc-1.0.-.fc19.x86_64 / Installed:
gcc.x86_64 :4.8.-.fc19 Dependency Installed:
cpp.x86_64 :4.8.-.fc19 glibc-devel.x86_64 :2.17-.fc19 glibc-headers.x86_64 :2.17-.fc19 libmpc.x86_64 :1.0.-.fc19 Complete!

install gcc-c++

[root@localhost Jorcen]# yum -y install gcc-c++
Loaded plugins: fastestmirror, langpacks, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirrors.yun-idc.com
* livna: ftp-stud.fht-esslingen.de
* rpmfusion-free: mirror.bjtu.edu.cn
* rpmfusion-free-updates: mirror.bjtu.edu.cn
* rpmfusion-nonfree: mirror.bjtu.edu.cn
* rpmfusion-nonfree-updates: mirror.bjtu.edu.cn
* updates: mirrors.yun-idc.com
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 :4.8.-.fc19 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.-.fc19 for package: gcc-c++-4.8.-.fc19.x86_64
--> Running transaction check
---> Package libstdc++-devel.x86_64 :4.8.-.fc19 will be installed
--> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================
Installing:
gcc-c++ x86_64 4.8.-.fc19 updates 7.1 M
Installing for dependencies:
libstdc++-devel x86_64 4.8.-.fc19 updates 1.5 M Transaction Summary
======================================================================================================================================================
Install Package (+ Dependent package) Total download size: 8.6 M
Installed size: M
Downloading packages:
(/): libstdc++-devel-4.8.-.fc19.x86_64.rpm | 1.5 MB ::
(/): gcc-c++-4.8.-.fc19.x86_64.rpm | 7.1 MB ::
------------------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | 8.6 MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libstdc++-devel-4.8.-.fc19.x86_64 /
Installing : gcc-c++-4.8.-.fc19.x86_64 /
Verifying : libstdc++-devel-4.8.-.fc19.x86_64 /
Verifying : gcc-c++-4.8.-.fc19.x86_64 / Installed:
gcc-c++.x86_64 :4.8.-.fc19 Dependency Installed:
libstdc++-devel.x86_64 :4.8.-.fc19 Complete!

other

yum -y install gcc
yum -y install gcc-c++
yum install make -- 或者
yum groupinstall "Development Tools" -- 或者
yum install gcc gcc-c++ kernel-devel

yum安装gcc的更多相关文章

  1. 【转载·】Linux yum 安装 gcc 、gcc-c++

      2017年09月29日 22:45:54 上善若水 阅读数:6653更多 个人分类: Linux学习 所属专栏: Linux学习杂技   版权声明:本文为博主原创文章,未经博主允许不得转载. ht ...

  2. centos使用yum安装gcc

    yum -y install gccyum -y install gcc-c++yum install make -- 或者yum groupinstall "Development Too ...

  3. yum安装gcc和gcc-c++

    本次总结参考 博客:http://blog.csdn.net/robertkun/article/details/8466700  ,非常 感谢他的博客,帮我解决了问题. 今天安装gcc-c++时出现 ...

  4. 加快Linux上yum下载安装包的速度(以CentOS 7,安装gcc为例)

    今天在学习Linux的过程中,学到了关于包的安装问题:rpm包管理和yum在线管理两种方式:这里因为我在实验yum安装gcc出现了网速超级慢的问题,于是搜索解决方案,重新配置repo得以解决,记录整个 ...

  5. Linux安装gcc编译器详解

    本人使用的是CentOS 6.5 64位系统,由于在安装系统的时候并没有勾选安装gcc编译器,因此需要自行安装gcc编译器. 使用yum安装gcc 对于配备了yum的Linux发行版而言,安装gcc编 ...

  6. Linux——CentOS7安装gcc编译器详解

    使用yum安装gcc 使用yum命令安装还是非常easy的. yum -y install gcc gcc-c++ kernel-devel //安装gcc.c++编译器以及内核文件 手动安装gcc ...

  7. CentOs下安装gcc/g++/gdb

    使用yum安装gcc:yum install gcc即可.使用:which gcc 查看是否安装成功 使用yum安装g++:yum install gcc-c++ 即可.使用:which g++ 查看 ...

  8. [Linux系统] (3)应用安装方式详解(编译安装、rpm包安装、yum安装)

    软件的安装方式: 编译安装 RPM包安装 yum安装 一.编译安装 1.下载一个源码安装包:tengine-2.3.0.tar.gz.这是淘宝二次开发过的nginx.将其解压. .tar.gz 2.查 ...

  9. centos 安装gcc时,出错:Found 10 pre-existing rpmdb problem(s), 'yum check' output follows:

    别人折腾的系统. 刚开始,准备安装下tornado,报错,需要安装 gcc 和 python-devel gcc安装报错,如标题所示: 谷歌了一把: http://stackoverflow.com/ ...

随机推荐

  1. 神奇的CSS3选择器

    话说园子里也混迹多年了,但是基本没写过blog,写点基础的,那就从css3选择器开始吧. Css3选择器 先说下,为什么提倡使用选择器. 使用选择器可以将样式与元素直接绑定起来,在样式表中什么样式与什 ...

  2. 第一回 认识Bootstrap

    Bootstrap 是Twitter推出的一个用于前端开发的开源工具包. Bootstrap是基于HTML5和CSS3开发的,它在jQuery的基础上进行了更为个性化和人性化的完善,形成一套自己独有的 ...

  3. HDOJ2027统计元音

    统计元音 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submis ...

  4. Android之帧动画2

    创建自定义对话框: // 对话框构建器 Builder builder = new AlertDialog.Builder(this); // 创建出一个空的对话框 final AlertDialog ...

  5. linux 运维知识体系

    这里将会介绍一下,LINUX运维工程师的知识体系. 只能说是个人理解吧.并不是必要或者充分的,仅供网友参考. 大部分本博客都有涉及,并不完整. 1.LINUX运维基础 1.1.LINUX系统的简介,分 ...

  6. ubuntu grub配置

    一.Grub 2包含如下几部分内容:1./boot/grub/grub.cfg 文件2./etc/grub.d/ 文件夹3./etc/default/grub 文件 二.配置和意义: 1.修改grub ...

  7. doctype的种类

    现实生活中人们使用的浏览器是各式各样的!为了防止各各浏览器页面设置不一样而照成我们所做的网页乱序,不得不设置doctye(文档类型):doctype有3中类型:* 过渡的(Transitional): ...

  8. Mac下使用Web服务器性能/压力测试工具webbench、ab、siege

    Web开发,少不了的就是压力测试,它是评估一个产品是否合格上线的基本标准,下面我们来一一剖析他们的使用方式. 测试前,前面先把系统的端口限制数改大,看看Mac下面的默认限制 ulimit -a ope ...

  9. javascript实现URL不缓存的方法

    <script> document.write("<s"+"cript type='text/javascript' src='/js/test.js? ...

  10. Iso8601 日期格式

    unit Iso8601Unit; interface type TIso8601 = class(TObject) public class function DateTimeFromIso8601 ...