在一个新的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
---- ::-- http://mirrors.163.com/.help/CentOS5-Base-163.repo
Resolving mirrors..com... 123.58.173.186,123.58.173.185
Connecting to mirrors..com|123.58.173.186|:...connected.
HTTP request sent, awaiting response... OK
Length: (.3K) [application/octet-stream]
Saving to: `CentOS5-Base-.repo' %, --.-K/s in 0s -- :: ( MB/s) -`CentOS5-Base-.repo' saved [2341/2341]

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

[root@localhost~]# mv CentOS5-Base-.repo /etc/yum.repos.d/

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

3.清除原有缓存

[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

4.获取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 :
addons/filelists_db | B :
addons/other_db | B :
addons/primary_db | 1.1 kB :
base | 1.1 kB :
base/filelists | 3.7 MB :
base/other | MB :
base/group | 1.1 MB :
base/primary | 1.3 MB :
epel | 3.6 kB :
epel/filelists_db | 4.1 MB :
epel/updateinfo | kB :
epel/other_db | 1.6 MB :
epel/primary_db | 2.9 MB :
extras | 2.1 kB :
extras/filelists_db | kB :
extras/other_db | kB :
extras/group | 9.7 kB :
extras/primary_db | kB :
updates | 1.9 kB :
updates/filelists_db | 2.1 MB :
updates/other_db | MB :
updates/primary_db | kB :
base /
base /
base /
Metadata Cache Created

5.搜索安装

[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 support
gcc-gnat.x86_64 : Ada 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++

参考:http://www.openskill.cn/article/126

----------------------阿纪

Linux RedHat无法安装软件问题(No package gcc available. Nothing to do)的更多相关文章

  1. linux安装软件的几种方法----linux下编译安装软件的一般步骤

    linux安装软件的几种方法: 一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root用户: 3.cd so ...

  2. Linux系统中安装软件方法总结

    Linux系统中安装软件方法总结 [1]Linux系统中安装软件的几种方式 [2] Linux配置yum源(本地源和网络源) [3] SuSE下zypper源配置 [4] SUSE zypper 本地 ...

  3. Linux 下如何安装软件?

    http://zhidao.baidu.com/link?url=OkQCOZtVMXhasC8x9zFTZOumsFKf0WW25Ckr2wBF1xO08EsjrBpnMaTBlIAUYdxZ408 ...

  4. linux下如何安装软件(转载)

    来源:http://zhidao.baidu.com/link?url=5oR8WxygPvVMhSZvXQahYKm01JPTmQnEUjbQF562Yxgd3r6bYpki1ZPcHAsij6E4 ...

  5. Linux系统中安装软件的几种方式

    转载:https://blog.csdn.net/qq_36119192/article/details/82866329 好长时间没有静下心来学习一下linux了 最近对linux安装软件有了点小小 ...

  6. Linux 下如何安装软件

    一.解析Linux应用软件安装包 通常Linux应用软件的安装包有三种: 1) tar包,如software-1.2.3-1.tar.gz.它是使用UNIX系统的打包工具tar打包的. 2) rpm包 ...

  7. [转]linux中如何安装软件?

    Linux下软件的安装与卸载     在Windows下安装软件时,只需运行软件的安装程序(setup.install等)或者用zip等解压缩软件解开即可安装,运行反安装程序 (uninstall.u ...

  8. Linux Centos 下安装软件 三种方式(转)

    Linux学习的路还很远呢,各位码农,新年快乐哈! 1)一种是软件的源代码,您需要自己动手编译它.这种软件安装包通常是用gzip压缩过的tar包(后缀为.tar.gz). 2)另一种是软件的可执行程序 ...

  9. Linux编程 18 安装软件程序(yum工具对软件包安装,删除,更新介绍)

    一.   概述 本篇介绍在linux上见到的各种包管理系统(package management system,PMS)用来进行软件安装,管理,删除的命令行工具.PMS是利用一个数据库来记录各种相关内 ...

随机推荐

  1. delphi 修改Hint的字体和颜色

    //修改Hint的字体和颜色   public    { Public declarations }    procedure Sshowhint(var hintstr:string;var can ...

  2. Plus One @LeetCode

    import java.util.Arrays; /** * Plus One * * Given a number represented as an array of digits, plus o ...

  3. [AngularJS] Provider

    This lesson describes what is really happening when you use the angularfactory and how you can make ...

  4. iOS开发UI-利用Quartz2D 实现基本绘图(画三角形、矩形、圆、圆弧)

    1.画三角形  运行结果如下 1.1具体实现步骤 1.1.1首先新建一个project,然后自定义一个view 1.2代码 #import "htingShapeView.h" @ ...

  5. 【Github教程】史上最全github用法:github入门到精通

    原文 http://www.eoeandroid.com/thread-274556-1-1.html [初识Github] 首先让我们大家一起喊一句"Hello Github". ...

  6. oc-11-结构体

    #import <Foundation/Foundation.h> /* 设计一个“学生”类 1)属性 姓名 生日 用结构体作为类的实例变量(生日) 定义结构用来描述 生日 类名: Stu ...

  7. jQuery的动画效果

    jQuery 是一个 JavaScript 库.jQuery 库可以通过一行简单的标记被添加到网页中. <script type="text/javascript" src= ...

  8. Java设计模式13:常用设计模式之桥接模式(结构型模式)

    1. Java之桥接模式(Bridge Pattern) (1)概述: 首先我们说一个生活中的例子:       就拿汽车在路上行驶的来说.即有小汽车又有公共汽车,它们都不但能在市区中的公路上行驶,也 ...

  9. 机器学习之SVM(支持向量机)

    支持向量机(SVM)是当前非常流行的监督学习方法,其核心主要有两个: 构造一个极大边距分离器--与样例点具有最大可能距离的决策边界: 将在原输入空间中线性不可分的样例映射到高维空间中,从而进行线性分离 ...

  10. LeetCode 242

    Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For ...