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的软件包的,

最终找到一个解决办法文章来源地址https://www.yii666.com/article/758336.html

检查版本:

[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/网址:yii666.com<

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

3.清除原有缓存文章来源地址:https://www.yii666.com/article/758336.html

[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列表文章地址https://www.yii666.com/article/758336.html

[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的时候出现错误网址:yii666.com

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. Mysql mysqldumpslow命令详解

  2. Linux oracle 11g r2 安装前检查及安装

  3. 如何检查linux 下是否安装java(jdk)环境

  4. Linux下软件安装,卸载,管理

  5. Go在linux下的安装

  6. Linux(CentOs)下安装Phantomjs + Casperjs

  7. Linux RedHat无法安装软件问题(No package gcc available. Nothing to do)

  8. linux telnet服务安装与配置

    关闭防火墙:service iptabls stop            chkconfig iptabls off1、安装telnet服务[root@rheltest1 ~]# rpm -qa |grep telnet   //检查是否安装这相关软件包telnet-0.17-47.el6.x86_64telnet-server-0.17-47.el6.x86_64如果未安装,配置YUM源,使用yum install telnet telnet-server命令安装2、开启telnet服务(因为tel

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信图片_20190322181744_03.jpg

微信扫一扫打赏

请作者喝杯咖啡吧~

支付宝扫一扫领取红包,优惠每天领

二维码1

zhifubaohongbao.png

二维码2

zhifubaohongbao2.png