1.错误信息

已加载插件:langpacks, product-id, search-disabled-repos,
subscription-manager This system is not registered with an entitlement
server. You can use subscription-manager to register. There are no
enabled repos. Run “yum repolist all” to see the repos you have. To
enable Red Hat Subscription Management repositories:
subscription-manager repos --enable To enable custom repositories:
yum-config-manager --enable

2.解决步骤

在安装gcc的时候出现下面信息:

如果出现上面问题,只需要输入下面命令即可:
进入到/etc/yum.repos.d/目录,下载Centos-7.repo
下载的官网 http://mirrors.aliyun.com,复制下载链接

然后通过wget进行下载,如果没有wget可以直接下载Centos-7.repo,然后把Centos-7.repo文件上传到/etc/yum.repos.d/中即可

cd /etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

查看Centos-7.repo是否已经下载了

使用 yum clean allyum makecache 命令

如果 yum makecache256错误,修改CentOS-Base.repo文件即可:

vim /etc/yum.repos.d/CentOS-Base.repo

修改内容为(先删除原有内容,然后把替换为下面的内容,然后键盘esc键进入底行模式,输入 :wq 进行保存):

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-7 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#released updates
[updates]
name=CentOS-7 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful
[extras]
name=CentOS-7 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

再次执行 yum makecache 命令

最后再次使用 yum install gcc 命令安装gcc,就可以成功安装了


yum 无法安装gcc 出现Run “yum repolist all” to see the repos you have异常相关推荐

  1. linux下Yum方式安装gcc

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

  2. 用本地光盘建yum仓库安装Gcc

    Centos用本地光盘建yum仓库安装Gcc 这几天需要搭建一个Centos的环境, 然后就丢过来一个裸机-.然后就开始一顿操作开始装--.(然而并不是Vmware workstation的那种简易安 ...

  3. Linux本地yum源配置以及使用yum源安装gcc编译环境

    本文档是图文安装本地yum源的教程,以安装gcc编译环境为例. 适用范围:所有的cetos,红帽,fedroa版本 适用人群:有一点linux基础的小白 范例系统版本:CentOS Linux rel ...

  4. yum 安装出现 /var/run/yum.pid 已被锁定

    问题描述 使用 bzip2 命令的时候提示「未找到命令」 [root@localhost ~]# bzip2 -c test.txt -bash: bzip2: 未找到命令 那就安装个 bzip2 吧 ...

  5. centos7中yum源安装mysql_centos7下使用yum安装mysql

    CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 $ wget http://repo.mysql.com ...

  6. 加快Linux上yum下载安装包的速度(以CentOS 7,安装gcc为例)

    今天在学习Linux的过程中,学到了关于包的安装问题:rpm包管理和yum在线管理两种方式:这里因为我在实验yum安装gcc出现了网速超级慢的问题,于是搜索解决方案,重新配置repo得以解决,记录整个 ...

  7. mysql安装无效安装源_(0.2.4)Mysql安装——yum源安装

    转自:https://www.cnblogs.com/jimboi/p/6405560.html 1.下载好对应版本的yum源文件 2.安装用来配置mysql的yum源的rpm包 可以用: yum r ...

  8. yum arm linux gcc 4.8,Linux-使用 yum 升级 gcc 到 4.8

    wget http://people.centos.org/tru/devtools-2/devtools-2.repo mv devtools-2.repo /etc/yum.repos.d yum ...

  9. linux 卸载32位rar,让CentOS能用yum自动安装rar和unrar

    目的:让CentOS能用yum自动安装rar和unrar 系统环境: CentOS 7.0 具体操作步骤如下: 1.编辑文件 编辑dag.repo文件,或者说是新建一个dag.repo文件. vi / ...

最新文章

  1. 最小生成树(prime算法、kruskal算法) 和 最短路径算法(floyd、dijkstra)
  2. “悬空指针”和“野指针”究竟是什么意思?有什么区别
  3. boost::test模块带有自定义初始化测试的静态库使用变体
  4. STM32跑分?看看你的能跑多少分!
  5. Visual Studio Code 使用 ESLint 增强代码风格检查 - gyzhao - 博客园
  6. Spring系列合并
  7. 西南交大计算机几个专业,西南交通大学计算机科学与技术专业
  8. android平台gallery2应用分析,Android5.1图库Gallery2代码分析数据加载流程
  9. [每日编程]求 largest Number - 给出一组非负整数,求这些非负整数可以拼接出的最大数字...
  10. linux 禁用 内核 驱动程序,Linux设备驱动程序学习----5.模块的初始化和关闭
  11. 性能提升一倍,云原生网关支持 TLS 硬件加速
  12. html多个单元格合并单元格内容,excel怎样快速把多个单元格内容合并 合并多个单元格内容的设置方法...
  13. 绝了!这款工具让 Spring Boot 不在需要 Controller、Service、DAO、Mapper 了
  14. 初步接触Oracle 11g(1)
  15. mysql my.ini设置root密码_mysql 5.7设置root密码 windows
  16. LeetCode链表简单题
  17. 用SET工具包制作钓鱼网站
  18. CentOS7—Firefox—截图工具—fireshot插件
  19. mmorpg游戏设计之2D游戏地图的九宫格子
  20. 《某担保业务管理系统》项目研发总结

热门文章

  1. python办公自动化价值是什么意思_办公自动化是什么意思,怎么实现?
  2. 【Unity3D】人物跟随鼠标位置
  3. 二维码图片生成工具C#winform源码
  4. 适合个人投资者的理财策略
  5. 让我们用 Node.js 写自己的 DDNS 动态域名程序
  6. oracle查询数据令某字段显示固定值
  7. 【报告分享】 2020年中国汽车用户消费洞察白皮-懂车帝巨量算数(附下载)
  8. 懂车帝与蛋蛋订车两大平台对比
  9. Nginx+Lua+Redis实现广告缓存
  10. 【2019-TGRS】Aerial LaneNet: Lane-Marking Semantic Segmentation in Aerial Imagery Using Wavelet-Enhanc