在CentOS7执行安装命令时,比如yum update等,会出现下面的报错。

Loaded plugins: fastestmirror
Error: invalid clean argument: 'yum'Mini usage:clean [headers|packages|metadata|dbcache|plugins|expire-cache|all]Remove cached data
[root@localhost ~]# yum install gcc -y
Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#56 - "Recv failure: Connection reset by peer"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=trueCannot find a valid baseurl for repo: base/7/x86_64

去修改它大致需要两步

第一步:vi /etc/resolv.conf,添加下面一行就可以了

nameserver 114.114.114.114(这是国内的dns服务器系统,还是比较好用的。谷歌的可以使用8.8.8.8)

或者

echo nameserver 114.114.114.114 > /etc/resolv.conf

修改完后service network restart进行重启,试一下yum update命令,应该就可以了。如果还不可以,可以再进行下一步。

第二步:

1. 在Linux系统中输入命令:   vi  /etc/sysconfig/network-scripts/ifcfg-ens33

2. 修改文件中的ONBOOT=no,将no改为yes

3. 重启服务: service network restart

如果是指定分配(类似)

CentOS7执行yum命令出错相关推荐

  1. yum命令报错在linux下,执行yum命令报错

    执行yum命令报错信息如下: [root@webserver ~]# yum list rpmdb: Thread/process 26604/140491933587200 failed: Thre ...

  2. 部署shiro官方源码时,执行maven命令出错

    转载自  部署shiro官方源码时,执行maven命令出错 部署shiro官方源码时,执行maven命令会报下面错误: [INFO] --------------------------------- ...

  3. centos7执行 wget命令: command not found的两种解决方法

    centos7执行 wget命令: command not found的两种解决方法 参考文章: (1)centos7执行 wget命令: command not found的两种解决方法 (2)ht ...

  4. 阿里云CentOS8服务器执行yum命令报错404

    今天想在阿里云CentOS8服务器上面安装mysql,执行yum命令报错: Errors during downloading metadata for repository 'AppStream': ...

  5. centos 安装java sdk_Linux——CentOS7使用yum命令安装Java SDK

    安装jdk有很多种方式比如我们可以在Oracle Technology Network>Java>Java SE>Download(点此链接跳转)下载jdk-8u25-linux-x ...

  6. CentOS7 无法使用yum命令,无法更新解决方法

    前言 设置网卡开机自动启动 设置国内dns服务器系统 修改CentOS-Base.repo中的地址 所参考的文章地址 前言 刚安装完的CentOS7的系统,发现无法使用yum命令进行更新,在更新的时候 ...

  7. 树莓派(Raspberry Pi 3) centos7使用yum命令报错File /usr/bin/yum, line 30 except KeyboardInterrupt, e:...

    使用yum命令报错 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid ...

  8. centos执行yum命令报错,There are no enable repos

    综合各种答案,归结原因有两大类 一:当前系统不支持yum工具 Linux系统分为两大类 RedHat系列:Redhat.Centos.Fedora.... 使用yum管理包,使用rpm命令安装rpm包 ...

  9. centos7安装yum命令,yum命令被玩坏了怎么办?

    一.前提是把yum卸载干净以及删除相关的配置文件和目录,卸载的教程可自行度娘 二.到下面这个网站去下载对应的rpm包Index of /centos/7/os/x86_64/Packages/http ...

最新文章

  1. python使用matplotlib可视化线图(line plot)、为可视化图像添加双Y轴、分别可视化不同范围的数据(double y axis in matplotlib)
  2. QRadioButton Toggled() 使用方法
  3. C语言符号位补码要变吗,补码与符号位取反
  4. 学习 Spring Boot:(二十九)Spring Boot Junit 单元测试
  5. python 中 yield 的使用
  6. Python常见设计模式
  7. Vijos P1816 统计数字【序列处理】
  8. Windows 2008 Core 常用命令
  9. 为什么要用火狐浏览器
  10. npm 升级所有依赖包
  11. 饥荒联机版Mod开发——制作简单的物品(三)
  12. SPSS-季节性分析
  13. pandas将df赋值到另一个df_pandas基础
  14. phpMyAdmin下载
  15. VUE | 过滤器的作用
  16. PS如何制作火焰效果图特效步骤教程
  17. 蓝牙车载 linux,《基于嵌入式Linux蓝牙在车载电子系统中的应用》.pdf
  18. python爬取下厨房每周最受欢迎菜谱
  19. 无计算机基础的学电子化移交,由于目标计算机积极拒绝,无法连接。 127.0.0.1-8080-这是什么意思啊...
  20. 【MySQL运维】使用gh-ost工具实现大表在线DDL变更

热门文章

  1. ETE - 在线可视化进化树和多序列比对
  2. 头顶距离顶部百分比_近距离接触COLMO子母太空舱洗衣机:“真分区洗”应该什么样...
  3. NOI数据结构:树套树
  4. 11产品经理要懂的-人性行为之善良友好的本质
  5. php制作后台驻留执行 ,同时提前返回逻辑信息进行判断的实例
  6. openfeign调用服务是否需要网关_阿里新一代微服务解决方案:Spring Cloud Alibaba
  7. html新增伪类,css3新增伪类有哪些
  8. Vue第一部分(6):Vue的生命周期
  9. C++|Qt工作笔记-C++获取当前系统时间,Qt获取当前系统时间及各标准间转化
  10. Linux工作笔记-解决spawn: not found与expect: not found问题(安装expect)