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是利用一个数据库来记录各种相关内 ...
随机推荐
- target=_parent与target=_top的区别与用途
转自:http://www.taoshaw.com/taoshaw/article.asp?id=1868 在手动改HTML代码时经常会用到target参数,常用的有两个target=_blank 和 ...
- 具体解释Android中AsyncTask的使用
在Android中实现异步任务机制有两种方式,Handler和AsyncTask. Handler模式须要为每个任务创建一个新的线程,任务完毕后通过Handler实例向UI线程发送消息,完毕界面的更新 ...
- 通过java实现对数据库的增删改查
package cn.hncu; import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet; ...
- POJ 3074 Sudoku (DLX)
Sudoku Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Statu ...
- LeetCode 345
Reverse Vowels of a String Write a function that takes a string as input and reverse only the vowels ...
- poj 2449 第k短路径
思路: 利用一个估计函数g[i]=dis[i]+len.其中len为队列出来的点当前已经走了的距离.dis[i]为该点到终点的最短路径.这样我们只要将点按g[i]的升序在队列你排序,每次取出最小的g[ ...
- poj 2446 二分图最大匹配
思路:由(i+j)为偶数的点向(i+j)为奇数的点建边.求一次最大匹配,若正好为空格数(不包含洞)的一半,即输出YES. #include<iostream> #include<cs ...
- insert 另外一种用法
then into dept01(id) values(deptno) then into dept02(id) values(deptno) else into dept03(id) values( ...
- CSS3 box-flex属性和box-orient属性
比较有意思的是虽然目前没有浏览器支持box-flex,box-orient属性,但CSS3问世以来,这两个属性却一直很火.2014年阿里校招第5题要求使用CSS3中的功能实现三个矩形的布局,总的宽度为 ...
- Quartz Scheduler(2.2.1) - Usage of CronTriggers
Cron is a UNIX tool that has been around for a long time, so its scheduling capabilities are powerfu ...