• 前言
  • 设置网卡开机自动启动
  • 设置国内dns服务器系统
  • 修改CentOS-Base.repo中的地址
  • 所参考的文章地址

前言

刚安装完的CentOS7的系统,发现无法使用yum命令进行更新,在更新的时候会出现下面这种内容,为此问题有以下这些解决方案可以尝试。

 One of the configured repositories failed (Unknown),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Disable the repository, so yum won't use it by default. Yum will thenjust ignore the repository until you permanently enable it again or use--enablerepo for temporary usage:yum-config-manager --disable <repoid>4. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

24

1

 One of the configured repositories failed (Unknown),

2

 and yum doesn't have enough cached data to continue. At this point the only

3

 safe thing yum can do is fail. There are a few ways to work "fix" this:

4

 

5

     1. Contact the upstream for the repository and get them to fix the problem.

6

 

7

     2. Reconfigure the baseurl/etc. for the repository, to point to a working

8

        upstream. This is most often useful if you are using a newer

9

        distribution release than is supported by the repository (and the

10

        packages for the previous distribution release still work).

11

 

12

     3. Disable the repository, so yum won't use it by default. Yum will then

13

        just ignore the repository until you permanently enable it again or use

14

        --enablerepo for temporary usage:

15

 

16

            yum-config-manager --disable <repoid>

17

 

18

     4. Configure the failing repository to be skipped, if it is unavailable.

19

        Note that yum will try to contact the repo. when it runs most commands,

20

        so will have to try and fail each time (and thus. yum will be be much

21

        slower). If it is a very temporary problem though, this is often a nice

22

        compromise:

23

 

24

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true


设置网卡开机自动启动

针对这个问题首先要确认网卡是否已经启动了,CentOS7最开始安装完的时候网卡可能会是关闭的,需要自己自行开启。

确保自己使用的是root账号,若不是,请自行更换。

1、进入/etc/sysconfig/network-scripts 目录。即输入命令 "cd /etc/sysconfig/network-scripts" ,使用命令 "ls -a" 可以查看该目录下的所有文件。

2、修改ifcfg-ens33的网卡配置文件(CentOS7修改了网卡命名规则,不再是eth0了,而是ifcfg-eno+数字)。输入命令 "vi ifcfg-ens33" 进入vi编辑器,按下"i"或者"insert"键进入编辑模式。

3、将 "ONBOOT" 的值修改为 "yes" ,之后按esc退出编辑模式,输入 ":wq" 保存退出

4、重启系统或者重启网卡,输入命令 "reboot" 或 "service network restart"。


设置国内dns服务器

若已经开启了网卡还是存在该问题可以尝试配置下国内的dns。

1、输入命令 "vi /etc/resolv.conf"

2、添加 "nameserver 114.114.114.114"

3、保存后,重启系统或者重启网卡,输入命令 "reboot" 或 "service network restart"。


修改CentOS-Base.repo中的地址

若上述方法还是无效可以尝试修改CentOS-Base.repo中的地址

1、进入 "/etc/yum.repos.d" 。

2、编辑 "vi CentOS-Base.repo" 。

3、将所有的 "mirrorlist" 注释掉,将所有的 "baseurl" 取消注释。

4、保存后,重启系统,输入命令 "reboot" 。

CentOS7 无法使用yum命令,无法更新解决方法相关推荐

  1. CentOS 7 - 最小化安装后,解决无法使用yum命令问题!!

    CentOS 7 - 最小化安装后,解决无法使用yum命令问题!! 参考文章: (1)CentOS 7 - 最小化安装后,解决无法使用yum命令问题!! (2)https://www.cnblogs. ...

  2. HBuild X 终端无法使用,无法输入的解决方法

    HBuild X 终端无法使用,无法输入的解决方法 1.更新到最新版本 2.安装内置终端 3.在工具中用内置命令npm install 4.重新打开终端就可以输入

  3. Linux rz命令安装失败解决方法

    关于Linux中rz 命令下载失败解决方法 解决方法(一) 解决方法(二)个人推荐以下配置方法(方便简洁) 1.首先通过命令cd /export/software rz 判断是安装命令 2.若出现 c ...

  4. 接收到开始本地截图的命令:videoshot.exe 解决方法

    接收到开始本地截图的命令:videoshot.exe 解决方法 近几天在家闲来无事,看些电视剧,用迅雷边下边看,但是从今天起老是出现这个窗口: 以为电脑中招了 后来查了,才发现是迅雷的问题,用下面的方 ...

  5. yum安装软件出错解决方法

    yum安装软件出错解决方法 造成yum下载安装时语法出错, 一般是由于python多个版本共存的原因. 所以,只需将yum 设置文件固定python 版本,也就是python2 下面的操作能解决版本冲 ...

  6. Linux系统centos7+VMwareWorkstation创建共享文件夹错误解决方法集锦

    Linux系统centos7+VMwareWorkstation创建共享文件夹错误解决方法集锦 参考文章: (1)Linux系统centos7+VMwareWorkstation创建共享文件夹错误解决 ...

  7. uniapp App更新解决方法

    uniapp App更新解决方法 最近项目碰到的app更新问题,安卓和iOS更新. 功能实现效果 安卓端:后台下载,自动弹出系统安装界面 iOS端:跳转 appStore app更新界面 1.获取用户 ...

  8. 海岛奇兵服务器维护中怎么办,海岛奇兵无法更新解决方法介绍

    今天小编为大家带来了海岛奇兵无法更新解决方法介绍,感兴趣的朋友们可以跟着小编一起去下文了解一下哦! <海岛奇兵>的游戏版本更新是相当之频繁的,经常会有小伙伴们出现无法更新的情况,当然会急死 ...

  9. ios王者荣耀服务器维护31号,王者荣耀iOS版3月31日无法更新怎么办 王者荣耀iOS玄雍危机版本无法更新解决方法...

    王者荣耀iOS版3月31日无法更新怎么办?3月31日王者荣耀玄雍危机版本更新,但不少iOS版的玩家发现自己无法更新,不知道是怎么回事,下面小编为大家带来了王者荣耀iOS玄雍危机版本无法更新解决方法,要 ...

最新文章

  1. 软件包管理 之 Fedora Extras(Fedora 计划的扩充资源) rpm.livna.org软件仓库的介绍和应用...
  2. 在Python这条路上踩过的坑(1)
  3. Linux 查看负载
  4. 未來用工新趨勢_数字化商业浪潮来袭 未来用工新趋势成焦点
  5. 【语法解释】init
  6. 《Linux》解决Linux端口被占用
  7. Win10 + VSCode踩坑 + vue项目开发:设置vscode终端为管理员权限
  8. MATLAB模拟导热过程,一维热传导MATLAB模拟.doc
  9. 这几道Redis面试题都不懂,怎么拿到阿里后端offer?
  10. java 对象转map,map转对象
  11. 教你快速将多个TXT文档合并成一个
  12. word文件做一半未响应_WORD文件一编辑就未响应如何处理
  13. 《孙子兵法战略运筹之谋攻篇》
  14. win10 安装 GPU版TensorFlow
  15. oracle xla相关,【EBS】XLA_GLT表的清理
  16. 排序-------冒泡实现(Java实现)
  17. 如何编写敏捷开发中的user story
  18. html歌曲朋友圈,深夜听歌朋友圈的文案
  19. PS动作制作科技节海报设计数字人物效果
  20. 信息物理系统CPS工业信息物理系统ICPS

热门文章

  1. Round3:我的黑白框雷霆战机进阶2
  2. 值得收藏的旭日阳刚的几首歌视频
  3. 【科普新力量】— 妙小程管春华:科普推动编程成为基础学科
  4. DSP/BIOS的基本介绍
  5. ProcessingJoy —— 简单的 3D 文字【JAVA】
  6. 手机之父出生 | 历史上的今天
  7. Detection:目标检测常用评价指标的学习总结(IoU、TP、FP、TN、FN、Precision、Recall、F1-score、P-R曲线、AP、mAP、 ROC曲线、TPR、FPR和AUC)
  8. ajax从服务端获取数据(服务端返回html、xml)
  9. shell programming tutorial
  10. 图片加载失败时,显示默认图片