Linux 下 gcc的安装

  • gcc的安装
    • 问题
    • 检查版本
    • 解决过程

gcc的安装

问题

在一个新的Linux服务器上安装nginx的时候,命令都不能解析,缺少gcc编辑器,安装gcc的命令也出错。

 [root@localhost ~]# yum -y install gcc
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
No package gcc available.
Nothing to do

没有gcc的软件包的,
最终找到一个解决办法

检查版本

[root@localhost ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Kernel \r on an \m

解决过程

1.下载163安装源

    [root@localhost~]# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
--2015-10-09 14:33:10-- http://mirrors.163.com/.help/CentOS5-Base-163.repo
Resolving mirrors.163.com... 123.58.173.186,123.58.173.185
Connecting to mirrors.163.com|123.58.173.186|:80...connected.
HTTP request sent, awaiting response... 200 OK
Length: 2341 (2.3K) [application/octet-stream]
Saving to: `CentOS5-Base-163.repo'100%2,341       --.-K/s   in 0s     2015-10-09 14:33:22 (108 MB/s) -`CentOS5-Base-163.repo' saved [2341/2341]

2.修改repo文件(根据红帽版本)

[root@localhost~]# mv CentOS5-Base-163.repo /etc/yum.repos.d/ *** 把$releasever替换成5 (红帽6版本以上的改为6)
[root@localhost yum.repos.d]# sed -i 's#$releasever#5#g' ./CentOS5-Base-163.repo

2.清除原有缓存

[root@localhost yum.repos.d]# yum clean all
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Cleaning up Everything

2.获取yum列表

[root@localhost yum.repos.d]# yum makecache
Loaded plugins: katello, product-id, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
addons                                                                                                 | 1.9 kB     00:00
addons/filelists_db                                                                                    |  570 B     00:00
addons/other_db                                                                                        |  554 B     00:00
addons/primary_db                                                                                      | 1.1 kB     00:00
base                                                                                                   | 1.1 kB     00:00
base/filelists                                                                                         | 3.7 MB     00:11
base/other                                                                                             |  14 MB     01:04
base/group                                                                                             | 1.1 MB     00:03
base/primary                                                                                           | 1.3 MB     00:06
epel                                                                                                   | 3.6 kB     00:00
epel/filelists_db                                                                                      | 4.1 MB     00:16
epel/updateinfo                                                                                        | 510 kB     00:02
epel/other_db                                                                                          | 1.6 MB     00:05
epel/primary_db                                                                                        | 2.9 MB     00:14
extras                                                                                                 | 2.1 kB     00:00
extras/filelists_db                                                                                    | 224 kB     00:00
extras/other_db                                                                                        | 442 kB     00:01
extras/group                                                                                           | 9.7 kB     00:00
extras/primary_db                                                                                      | 173 kB     00:00
updates                                                                                                | 1.9 kB     00:00
updates/filelists_db                                                                                   | 2.1 MB     00:09
updates/other_db                                                                                       |  11 MB     00:29
updates/primary_db                                                                                     | 531 kB     00:00
base                                                                                                                3667/3667
base                                                                                                                3667/3667
base                                                                                                                3667/3667
Metadata Cache Created

2.搜索安装

[root@localhost ~]# yum search gcc |grep --color '^gcc'
gcc.x86_64 : Various compilers (C, C++, Objective-C, Java, ...)
gcc-c++.x86_64 : C++ support for GCC
gcc-gfortran.x86_64 : Fortran 95 support
gcc-gnat.x86_64 : Ada 95 support for GCC
gcc-java.x86_64 : Java support for GCC
gcc-objc++.x86_64 : Objective-C++ support for GCC
gcc-objc.x86_64 : Objective-C support for GCC
gcc44.x86_64 : GNU Compiler Collection version 4.4
gcc44-c++.x86_64 : C++ support for GCC version 4.4
gcc44-gfortran.x86_64 : Fortran support for GCC 4.4

6.安装gcc

[root@localhost yum.repos.d]# yum -y install gcc

至此gcc安装完成。
但是当我安装pcre-8.39 执行./configure的时候出现错误

configure: error: You need a C++ compiler for C++ support

解决办法:

yum install -y gcc gcc-c++

参考: (https://www.cnblogs.com/sunjiguang/p/5970217.html)

Linux 下 gcc的安装相关推荐

  1. Linux下GCC的安装,GCC链接外部库

    GCC的安装 环境RedHatLinuxAS5 安装盘:RedHatLinuxAS5正式版DVD.iso 查看gcc版本: # gcc -v 检查是否安装rpm包 # rpm -qa | grep r ...

  2. linux下Yum方式安装gcc

    linux下Yum方式安装gcc学习记录 从CentOS7的系统安装镜像中取出需要的rpm包(也可以通过别的方式获取):解压镜像文件,进入"Packages"目录,里面很多rpm包 ...

  3. linux下从git获取有权限的代码,linux下从源代码安装git

    之所以有这样的需求,是因为部分预安装的git版本太低,很多功能没有并且安全性存在问题. 比如git submodule add xxx@host:yyy.git必须在父repo的root目录安装,而新 ...

  4. Linux下cacti的安装RedHat9,RedHat AS4

    Linux下cacti的安装RedHat9,RedHat AS4 2007-12-22 21:47:28   Cacti安装手册         第一步. Cacti的架构  第三步. Cacti简介 ...

  5. linux apache 安装 rewrite,linux下单独编译安装Apache rewrite_module

    Redhat linux下单独编译安装Apache rewrite_module Apache已经编译安装完了,今天弄了个lifebox,装完后发现必须得用rewrite,所以就给它装了个~~ 找到a ...

  6. Linux下Nginx编译安装过程详解

    Linux下Nginx编译安装过程详解 一.Nginx介绍 二.Nginx源码下载 1.打开Nginx官网 2.下载官网的源码包 三.Nginx源码安装 1.解压源码包 2.安装开发包组及环境 3.编 ...

  7. linux下编译libuv,linux下libuv库安装教程

    下载并编译libuv libuv需要自己手动下载源码,并手动编译. 当前目录为:/home/xlz/test/github/,在后面,会用$PATH来代替,我的系统的Debian8,64bit. $g ...

  8. Linux下OpenSSL的安装与使用

    Linux下OpenSSL的安装与使用 OpenSSL简介 OpenSSL是一个SSL协议的开源实现,采用C语言作为开发语言,具备了跨平台的能力,支持Unix/Linux.Windows.Mac OS ...

  9. Linux下MPlayer的安装

    Linux下MPlayer的安装 收藏 mplayer是linux下播放速度最快(正确安装了显卡驱动),支持媒体格式最多的播放器之一 ,它几乎能播放所有的win媒体文件!下面介绍它的安装方法: 安装大 ...

最新文章

  1. (转)教你实现Winform窗体的四边阴影效果
  2. python 查看当前目录_「Python」打包分发工具setuptools学习
  3. 【Flink】 producer attempted to use a producer id which is not currently assigned to its transaction
  4. python不定长的参数*,**使用(三分钟读懂)
  5. FISCO BCOS源码(1)代码目录结构
  6. 基于java+swing的物业收费管理系统(java+swing+Gui)
  7. 网站banner设计有什么好的方法
  8. 【Python学习】pandas 删除重复行
  9. oracle stdevp函数,适用于sql初学,学习sql语句的一些整理,其中大多是oracle的
  10. matplotlib learning-----案例:对比电影的票房收入(3)
  11. 关闭Linux防火墙
  12. 微软Win10这些黑科技小功能你都用过吗
  13. 微信企业号通过token和userId获取用户头像
  14. 数据分析师,岗位真相最全解析!
  15. npm丢失报错Error: Cannot find module ‘D:\node_modules\npm\bin\npm-cli.js‘
  16. DB-Engines 5月数据库排名:MySQL或将超越Oracle?
  17. 网络工程师的python之路pdf_网络工程师的Python之路---Ansible篇
  18. linux debian 安装gcc,如何在Debian 10 Linux上安装GCC编译器
  19. 三月上旬总结(认真的)
  20. python怎么定义一个数字_Python数字变量定义赋值

热门文章

  1. 5G/NR - Numerology
  2. 关闭CentOS系统自动更新服务
  3. java动物类_Java创建动物类animal,以及其子类
  4. 2021-12-07 股票模拟交易心得5
  5. iMazing如何从 iCloud 照片库下载照片
  6. java开发常用的中间件
  7. ES6新特性都有哪些
  8. 耐看娱乐冲刺IPO,七成收入源自网剧,能否穿越影视寒冬?
  9. NumPy-简单的统计分析
  10. ios safari 描述文件 跳转到_IOS APP与APP和APP与Safari间的跳转