Loaded plugins: fastestmirrorDetermining fastest mirrorsCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was14: curl#7 - "Failed to connect to 2600:1f16:c1:5e01:4180:6610:5482:c1c0: Network is unreachable"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. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ..4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-manager repos --disable=<repoid>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 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
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
http://mirrors.aliyun.com/repo/Centos-7.repo
然后打开SSH连接软件,找到/etc/yum.repos.d文件,将上面下载的repo文件直接拖到远程软件中
mv CentOS-Base.repo CentOS-Base.repo.bak
[姓名] #随便起
name=随便起
baseurl=file://(挂载点)
gpgcheck=0(不检查密钥,1是检查密钥)
enabled=1(让yum源配置文件生效)
清除之前的缓存 yum clean all
创建新的缓存 yum makecache
No package nginx available.
(自己换了好几个虚拟机,然后发现是没有包的问题,一直报错!决定写下来~)
本文链接:https://blog.runxinyun.com/post/377.html 转载需授权!
留言0