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

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS7执行yum命令出错

發(fā)布時(shí)間:2025/3/15 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CentOS7执行yum命令出错 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

在CentOS7執(zhí)行安裝命令時(shí),比如yum update等,會(huì)出現(xiàn)下面的報(bào)錯(cuò)。

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(這是國(guó)內(nèi)的dns服務(wù)器系統(tǒng),還是比較好用的。谷歌的可以使用8.8.8.8)

或者

echo nameserver 114.114.114.114 > /etc/resolv.conf

修改完后service network restart進(jìn)行重啟,試一下yum update命令,應(yīng)該就可以了。如果還不可以,可以再進(jìn)行下一步。

?

第二步:

1. 在Linux系統(tǒng)中輸入命令:?? vi??/etc/sysconfig/network-scripts/ifcfg-ens33

2. 修改文件中的ONBOOT=no,將no改為yes

3. 重啟服務(wù): service network restart

?

如果是指定分配(類似)

總結(jié)

以上是生活随笔為你收集整理的CentOS7执行yum命令出错的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

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