日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

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

最小化安裝的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

?

百度了一下這個錯誤,發(fā)現(xiàn)報錯原因是“本機無法連接網(wǎng)絡的網(wǎng)絡設置”的原因。

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

配置CentOS 7的網(wǎng)絡,步驟如下:

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

1 [root@localhost ~]# nmcli d 2 設備 類型 狀態(tài) 連接 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

動態(tài)配置 或 靜態(tài)配置

????動態(tài)配置

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

??BOOTPROTO=dhcp
? ONBOOT=yes

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

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

?測試網(wǎng)絡是否成功

?

???靜態(tài)配置??

?依次將第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

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

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

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

?

?

?

?

?

?

轉(zhuǎn)載于:https://www.cnblogs.com/leo2li/p/8275581.html

總結(jié)

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

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。