Linux RedHat无法安装软件问题(No package gcc available. Nothing to do)
在一个新的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)的更多相关文章
- linux安装软件的几种方法----linux下编译安装软件的一般步骤
linux安装软件的几种方法: 一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root用户: 3.cd so ...
- Linux系统中安装软件方法总结
Linux系统中安装软件方法总结 [1]Linux系统中安装软件的几种方式 [2] Linux配置yum源(本地源和网络源) [3] SuSE下zypper源配置 [4] SUSE zypper 本地 ...
- Linux 下如何安装软件?
http://zhidao.baidu.com/link?url=OkQCOZtVMXhasC8x9zFTZOumsFKf0WW25Ckr2wBF1xO08EsjrBpnMaTBlIAUYdxZ408 ...
- linux下如何安装软件(转载)
来源:http://zhidao.baidu.com/link?url=5oR8WxygPvVMhSZvXQahYKm01JPTmQnEUjbQF562Yxgd3r6bYpki1ZPcHAsij6E4 ...
- Linux系统中安装软件的几种方式
转载:https://blog.csdn.net/qq_36119192/article/details/82866329 好长时间没有静下心来学习一下linux了 最近对linux安装软件有了点小小 ...
- Linux 下如何安装软件
一.解析Linux应用软件安装包 通常Linux应用软件的安装包有三种: 1) tar包,如software-1.2.3-1.tar.gz.它是使用UNIX系统的打包工具tar打包的. 2) rpm包 ...
- [转]linux中如何安装软件?
Linux下软件的安装与卸载 在Windows下安装软件时,只需运行软件的安装程序(setup.install等)或者用zip等解压缩软件解开即可安装,运行反安装程序 (uninstall.u ...
- Linux Centos 下安装软件 三种方式(转)
Linux学习的路还很远呢,各位码农,新年快乐哈! 1)一种是软件的源代码,您需要自己动手编译它.这种软件安装包通常是用gzip压缩过的tar包(后缀为.tar.gz). 2)另一种是软件的可执行程序 ...
- Linux编程 18 安装软件程序(yum工具对软件包安装,删除,更新介绍)
一. 概述 本篇介绍在linux上见到的各种包管理系统(package management system,PMS)用来进行软件安装,管理,删除的命令行工具.PMS是利用一个数据库来记录各种相关内 ...
随机推荐
- ListView 文件重命名
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Control ...
- Github上最全的APICloud开源前端框架效果盘点(转)
1.微信网站几分钟变身“原生 App” 微信推出了微信JS-SDK,使微信公共号可以直接调用微信原生的接口,具备部分原生应用的能力.微信JS-SDK的推出,将大大提高微信公共号的 用户体验,但是如果存 ...
- [MEAN Stack] First API -- 7. Using Route Files to Structure Server Side API
Currently, the server.js is going way too long. In the real world application, it is likely that we ...
- onClick,onServerClick,onClientClick
<asp:button id=button1 runat=server test=button1 onclick=button1_onclick/> <input type=butt ...
- Android 官方文档:(二)应用清单 —— 2.10 <instrumentation>标签
syntax: <instrumentation android:functionalTest=["true" | "false"] ...
- 也来一篇关于Infragistics WPF Report的使用教程 (一)
前言 Infragistics Report是一款比較灵活的报表控件, 比微软的rdlc控件至少在页面打印上, 页面的控制比較好调整. 这里使用的是Infragistics Ultimate v14 ...
- oc-07-有参方法的调用
// 13-[掌握]有参方法的声明实现和调用 #import <Foundation/Foundation.h> void test(){ } @interface Person : NS ...
- STOMP协议规范--转载
原文地址:http://simlegate.com/2013/10/17/stomp-specification-1.2/ 摘要 STOMP是一个简单的可互操作的协议, 被用于通过中间服务器在客户端之 ...
- 小白日记20:kali渗透测试之后渗透测试阶段(一)--上传工具
后渗透测试阶段--上传工具 为防止管理员将漏洞补上后,我们无法再通过该漏洞控制对方主机,所以需要进行后渗透测试阶段 1.上传各种工具 2.提权:为了全面控制目标系统 3.擦除攻击痕迹:防止管理员通过日 ...
- 12096 - The SetStack Computer UVA
Background from Wikipedia: \Set theory is a branch of mathematics created principally by the German ...