Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

解决:CentOS7 - Cannot find a valid baseurl for repo: base/7/x86_6 #134

Open
jwenjian opened this issue Nov 2, 2019 · 0 comments
Open

Comments

@jwenjian
Copy link
Owner

jwenjian commented Nov 2, 2019

首次安装 CentOS7 之后,执行 sudo yum update 命令时提示如下错误:

Cannot find a valid baseurl for repo: base/7/x86_6

解决方法:

sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=no 改为ONBOOT=yes, 保存退出

再执行 sudo service network restart 重启网络即可。


20191106 更新:

如果以上命令执行完毕之后, 仍然提示同样的错误, 则:

cd /etc/yum.repos.d/
sudo vi CentOS-Base.repo

在 vi 中, 将所有mirrorlist=... 的配置项注释掉, 同时将 #baseurl=... 的配置项取消注释.

保存并退出即可

这个 repo 文件中也提到了这个问题:

# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant