版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。Centos7使用wget修改为阿里云镜像源
2. 错误:Could not retrieve mirrorlist http://mirrorlist.centos.org/?
1. 使用wget修改为阿里云镜像源
1.安装wget
yum install -y wget
2.完事前都做备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
如修改 /etc/yum.repos.d/CentOS-Base.repo
:%s/#baseurl/baseurl
3.下载阿里云镜像文件
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4.清理缓存
yum clean all
5.生成缓存
yum makecache
6.更新最新源设置
yum update -y
其他:
如果要手动修改的话:
就vi 修改 CentOS-Base.repo 全局替换
baseurl=http://mirror.centos.org/centos/ r e l e a s e v e r / u p d a t e s / releasever/updates/releasever/updates/basearch/
baseurl=http://mirrors.aliyun.com/centos/ r e l e a s e v e r / u p d a t e s / releasever/updates/releasever/updates/basearch/
替换为阿里云的地址
2. 错误:Could not retrieve mirrorlist http://mirrorlist.centos.org/?
[root@localhost yum.repos.d]# yum -y install gcc 已加