日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7arch=x86_64repo=osi...

發布時間:2025/3/15 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7arch=x86_64repo=osi... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最小化安裝的CentOS 7在運行yum安裝命令時報了以下錯誤:

1 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 2 3 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error" 4 5 One of the configured repositories failed (Unknown), 6 and yum doesn't have enough cached data to continue. At this point the only 7 safe thing yum can do is fail. There are a few ways to work "fix" this: 8 9 1. Contact the upstream for the repository and get them to fix the problem. 10 11 2. Reconfigure the baseurl/etc. for the repository, to point to a working 12 upstream. This is most often useful if you are using a newer 13 distribution release than is supported by the repository (and the 14 packages for the previous distribution release still work). 15 16 3. Disable the repository, so yum won't use it by default. Yum will then 17 just ignore the repository until you permanently enable it again or use 18 --enablerepo for temporary usage: 19 20 yum-config-manager --disable <repoid> 21 22 4. Configure the failing repository to be skipped, if it is unavailable. 23 Note that yum will try to contact the repo. when it runs most commands, 24 so will have to try and fail each time (and thus. yum will be be much 25 slower). If it is a very temporary problem though, this is often a nice 26 compromise: 27 28 yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

?

百度了一下這個錯誤,發現報錯原因是“本機無法連接網絡的網絡設置”的原因。

于是參照“How to Setup network on centos 7”這篇博文,配置了下DHPC,最終解決了這個error。

配置CentOS 7的網絡,步驟如下:

1.在終端中輸入以下命令,查看安裝在本機的網卡:

1 [root@localhost ~]# nmcli d 2 設備 類型 狀態 連接 3 ens33 ethernet 連接的 ens33 4 lo loopback 未托管 --

?

2.切換到/etc/sysconfig/network-scripts/目錄下,打開“ifcfg-ens33”文件:?

打開ifcfg-ens33文件,展開如下:

1 [root@localhost network-scripts]# vi ifcfg-ens33 2 3 TYPE=Ethernet 4 PROXY_METHOD=none 5 BROWSER_ONLY=no 6 BOOTPROTO=dhcp 7 DEFROUTE=yes 8 IPV4_FAILURE_FATAL=no 9 IPV6INIT=yes 10 IPV6_AUTOCONF=yes 11 IPV6_DEFROUTE=yes 12 IPV6_FAILURE_FATAL=no 13 IPV6_ADDR_GEN_MODE=stable-privacy 14 NAME=ens33 15 UUID=c71a84d9-bbd2-445d-bac8-d53d545055e0 16 DEVICE=ens33 17 ONBOOT=yes 18 IPV6_PRIVACY=no

動態配置 或 靜態配置

????動態配置

? 依次將第6行和第17行替換為:

??BOOTPROTO=dhcp
? ONBOOT=yes

? 然后,通過鍵入以下命令重新啟動網絡服務:

[root@localhost network-scripts]# systemctl restart network

?測試網絡是否成功

?

???靜態配置??

?依次將第2行和第11行替換為:

??BOOTPROTO=static
? ONBOOT=yes

? 然后,在文件末尾添加以下4行:

1 IPADDR=172.27.0.32 2 NETMASK=255.255.255.0 3 GATEWAY=172.27.0.1 4 DNS1=172.27.0.5

然后,通過鍵入以下命令重新啟動網絡服務:

[root@localhost network-scripts]# systemctl restart network

?centos查詢本機的外網IP: curl?ifconfig.me?命令即可查看

?

?

?

?

?

?

轉載于:https://www.cnblogs.com/leo2li/p/8275581.html

總結

以上是生活随笔為你收集整理的CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7arch=x86_64repo=osi...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。