CentOS7执行yum命令出错
生活随笔
收集整理的這篇文章主要介紹了
CentOS7执行yum命令出错
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在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命令出错的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android sendevent/ge
- 下一篇: javaWeb项目中获取ip为 0:0: