yum 命令无法使用

yum 命令无法使用一 yum 命令无法使用 root localhost yuminstallgi fastestmirro langpacksLoa mirrorlist centos org release

一、yum 命令无法使用

[root@localhost ~]# yum install git Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error 14: curl#7 - "Failed to connect to 2001:1b48:203::4:10: Network is unreachable" One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe 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 working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo= 
  
    ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable 
   
     or subscription-manager repos --disable= 
    
      5. 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 much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt= 
     
       .skip_if_unavailable=true Cannot find a valid baseurl for repo: base/7/x86_64 
      
     
    
  
yum -help 

2、确认是yum命令的问题,看出错信息: Network is unreachable,网络的问题—》网卡没有跟随系统启动,所以设置网卡跟随系统启动

找到网卡: [root@localhost network-scripts]# ifconfig enp0s3: flags=4163 
  
    mtu 1500 inet 192.168.1.111 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::aaa6:de:84ef:4350 prefixlen 64 scopeid 0x20 
   
     ether 08:00:27:90:6d:12 txqueuelen 1000 (Ethernet) RX packets 5268 bytes (499.6 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2124 bytes (372.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 
    
      mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 
     
       loop txqueuelen 1000 (Local Loopback) RX packets 4 bytes 344 (344.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 4 bytes 344 (344.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099 
      
        mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:55:79:f5 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 
       
      
     
    
  

3、找到网卡配置文件(ifcfg-enp0s3)之后修改参数:ONBOOT=no改为yes(如果没有配置文件,自己创建一个)

vim /etc/sysconfig/network-scripts/ifcfg-enp0s3 --------------------------------------------------------------------- TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=enp0s3 UUID=d4dae77b-4cbe-4234-93cd-9b0b3b7103ed DEVICE=enp0s3 ONBOOT=yes #修改此处参数将no改为yes IPADDR=192.168.1.23 PREFIX=24 GATEWAY=192.168.1.1 IPV6_PRIVACY=no ZONE=public 

4、重启网络:service network restart

5、检验:yum install 你要安装的服务

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/214668.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月18日 下午3:43
下一篇 2026年3月18日 下午3:43


相关推荐

  • JSON之解析

    JSON之解析

    2021年8月24日
    62
  • 机器学习框架及评估指标详解

    机器学习框架及评估指标详解目录机器学习的步骤train_test_split函数的详解机器学习评估指标分类模型评估指标混淆矩阵ROC曲线利用ROC的其他评估标准Python绘制ROC曲线求解AUC模板代码错误率精度查准率、查全率P-R曲线Python绘制P-R曲线模板代码平衡点(BEP)F1度量Python求解F1_score代码回归模型评估指标均方误差MAE(平均绝对误差)MAPE(平均绝对百分比误差)RMSE(均方根误差)RSquare(

    2022年6月16日
    30
  • python 写txt换行_python列表写入文件

    python 写txt换行_python列表写入文件将’w’ 改为’a’,是在文件后面写入,不替换原有文件然后 在你需要写入的数据前加上’\n’可实现换行,如图  

    2022年10月2日
    5
  • pycharm怎么配置tensorflow环境_python tensorflow安装

    pycharm怎么配置tensorflow环境_python tensorflow安装Pycharm安装并搭建Tensorflow开发环境下载并安装pycharm1.下载2.pycharm配置python环境安装tensorflow1.输入清华仓库镜像2.创建tensorflow环境3.启动tensorflow环境4.安装cpu版本的TensorFlow5.测试TensorFlowPycharm中配置TensorFlow环境在操作之前先安装好python环境,我是安装的Anaconda,Anaconda下载安装教程可参考:https://blog.csdn.net/Chen_Meng_

    2022年8月28日
    5
  • pip安装本地指定版本的whl文件

    pip安装本地指定版本的whl文件用pip装一些包的时候,由于pip默认的源也就那几个,换了清华的没用,豆瓣的也没用。。。老停在下载途中就不走了。。,所以就想到了能不能先把这些包down下来,然后本地进行安装呢?说干就干,这里以Tensorflow为例:1.下载.whl文件百度输入:TensorFlowpypi查看到最近能用的最新.whl版本为1.5.0rc1:点开该链接:选择好适合自己系统的版本,然后下载!重点来了:一般来说直…

    2022年6月5日
    113
  • 目前国内最快最稳定的DNS

    目前国内最快最稳定的DNS目前最快的DNS闲着没事做,给大家找了一下国内目前最快的DNS(我说是最快的,不是最稳定的,不保证DNS劫持);废话不多说,直接直接上图;最上面的是最快的,一次往下排;测试地点:上海浦东测试时间:2021年09月14使用工具:DNSBenchmark工具使用方法:工具使用方法:(我也是找地方copy的:https://www.52help.net/smarthome/300.html)DNSBenchmark安装使用详细步骤及教程1.先安装DNSBenchmark,可

    2022年5月2日
    149

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号