YumRepo错误:所有镜像URL都不使用ftp,http [s]或文件

The*_*mer 16 yum vmware-workstation centos6 windows-8.1

我在主机笔记本电脑上设置了一个centOS 6.5 server使用.尝试使用安装包时,出现以下错误:VMWare Workstation 9Windows 8.1yum

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. </html>/
removing mirrorlist with no valid mirrors: /var/cache/yum/i386/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
Run Code Online (Sandbox Code Playgroud)

VM可以在其他机器(Windows 7台式机和Windows 8.1笔记本电脑)上运行,而不是我需要的机器.我可以从来宾和来自主机的来宾ping主机,因此可以连接到互联网.

我已卸载并重新安装Workstation 9.未分级到工作站10.重建CentOS 6.5服务器.似乎没有什么能解决这个问题.

当我从Windows 8升级到Windows 8.1时,我安装了VMWare.后来我发现我应该在升级之前卸载VMWare.这可能搞砸了我的VMWare网络适配器吗?

有人有主意吗?

小智 23

请确保您可以ping vault.centos.org.

然后编辑 /etc/yum.repos.d/CentOS-Base.repo

评论mirrorlist并取消注释baseurl

改变一切

baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
Run Code Online (Sandbox Code Playgroud)

baseurl=http://vault.centos.org/$releasever/centosplus/$basearch/
Run Code Online (Sandbox Code Playgroud)

并享受你的yum更新!;)

  • 快速更改命令: `sudo sed -i '/^mirrorlist/s/^/#/;/^#baseurl/{s/#//;s/mirror.centos.org\/centos\/$releasever/ Vault.centos.org\/6.10/}'/etc/yum.repos.d/*B*`。请记住将 `6.10` 更改为您的实际版本(可以找到 `cat /etc/centos-release`)。 (9认同)
  • 这个*几乎*对我有用,我注意到它在http://vault.centos.org/5/上获得了404,所以我为实际版本(5.11)切换了$ releasever并且yum update工作,谢谢! (6认同)
  • 变量 $releasever 也可以在 /etc/yum/vars/releasever 中指定: `echo "6.10" &gt; /etc/yum/vars/releasever` (5认同)

小智 11

我认为此错误消息的另一个原因是您的版本不再受支持.这个帖子中没有任何建议对我有用,我的互联网连接很好,但后来我才意识到我正在运行Centos 5(我知道,古老......),它在2017年3月31日到达了它的生命周期 - 当yum repo错误开始出现时.

  • 这是对的。您必须将 repo http url 更改为“vault”。原来的 5* 位置不再有效。 (3认同)
  • 对于那些仍在寻找的人,您可能想尝试 Valut -&gt; http://vault.centos.org/centos/ 上列出的镜像之一。我在那里列出的官方镜像上找到了 5.5 版本。 (2认同)

mat*_*szb 11

Centos 6 版本上个月(2020 年 11 月 30 日)迎来了 EOL

您可以使用非官方镜中的一个通过上市的CentOS在你的/etc/yum.repos.d/CentOS-Base.repo。在我的情况 (6.10) 中,我使用了镜像http://mirror.nsc.liu.se/centos-store/6.10/并且运行顺利:

[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.nsc.liu.se/centos-store/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# same for the others [updates] etc in the file
Run Code Online (Sandbox Code Playgroud)

  • 谢谢,Centos 6.10,在/etc/yum.repos.d/CentOS-Base.repo中,使用mirror.nsc.liu.se/centos-store/6.10/[repo-name]替换所有repo URL,效果很好,救星:) (3认同)

Ste*_*let 7

这发生在我在远程网络上支持的系统上,我确定这是由于客户的 Check Point 防火墙干扰了正常的 HTTP 流量。我跑了一个sudo tcpdump -nn -c 500 -s0 -X port 80,看着 yum 被重定向到某种门户:

Location: http://x.x.x.x/UserCheck/PortalMain?....
Run Code Online (Sandbox Code Playgroud)

有趣的是,使用 很难重现curl,它可以毫无问题地检索镜像列表。我发现我必须添加用于触发 Check Point 干扰的User-agent: urlgrabber/3.1.0 yum/3.2.22HTTP 标头yum,如下所示:

$ curl -i \
    -H 'User-agent: urlgrabber/3.1.0 yum/3.2.22' \
    'http://108.61.16.227/?release=5&arch=x86_64&repo=os'
HTTP/1.1 307 Temporary Redirect
Location: http://x.x.x.x/UserCheck/PortalMain?IID=....origUrl=....
Connection: close
Run Code Online (Sandbox Code Playgroud)

谷歌搜索 UserCheck/PortalMain显示这是 Check Point 防火墙。我在那里隐藏的 IP ( x.x.x.x) 属于客户。这足以证明告诉客户他需要对他的防火墙进行某种更改,以允许我的系统畅通无阻地访问互联网(我不知道是什么,但我希望他和/或他的网络团队能够弄清楚)。


lis*_*ncy 5

对于centos 5.4,您可以/etc/yum.repos.d/CentOS-Base.repo像这样更改 。

[base]
name=CentOS-5.4 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=os
baseurl=http://vault.centos.org/5.4/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates 
[updates]
name=CentOS-5.4 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=updates
baseurl=http://vault.centos.org/5.4/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-5.4 - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=addons
baseurl=http://vault.centos.org/5.4/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-5.4 - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=extras
baseurl=http://vault.centos.org/5.4/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5.4 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=centosplus
baseurl=http://vault.centos.org/5.4/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5.4 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=$basearch&repo=contrib
baseurl=http://vault.centos.org/5.4/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Run Code Online (Sandbox Code Playgroud)


小智 5

在添加以下内容之前可以yum update -y帮助我解决问题:

yum clean all
echo "http://vault.centos.org/5.11/os/x86_64/" > /var/cache/yum/base/mirrorlist.txt
echo "http://vault.centos.org/5.11/extras/x86_64/" > /var/cache/yum/extras/mirrorlist.txt
echo "http://vault.centos.org/5.11/updates/x86_64/" > /var/cache/yum/updates/mirrorlist.txt
Run Code Online (Sandbox Code Playgroud)

顺便说一句,CentOS 5已经达到停产


Ama*_*mar 0

检查您是否能够 ping 通外部站点,例如 www.google.com。如果没有插入行:

nameserver 208.67.222.222
nameserver 208.67.220.220
Run Code Online (Sandbox Code Playgroud)

在/etc/resolve.conf中

也在 /etc/yum.repos.d/CentOS-Base.repo 中

取消注释所有镜像列表并注释掉所有baseurl

如果镜像列表不适合您,您可以仅尝试基本网址。

希望能帮助到你!!