继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Centos7.4安装镜像源和repo源

Jeson
关注TA
已关注
手记 74
粉丝 2万
获赞 3370

一、国内可选下载镜像源
1、国内
163镜像源(推荐选择)
http://mirrors.163.com/
中国技术科学大学
http://mirrors.ustc.edu.cn/
Centos官方站点
http://vault.centos.org/
2、Centos7.4下载地址
http://mirrors.163.com/centos/7.4.1708/isos/x86_64/CentOS-7-x86_64-DVD-1708.iso

二、配置Centos7.4的yum源
yum所需要使用的repo源如下:
在安装好的操作系统中,执行如下命令:
vim /etc/yum.repos.d/CentOS-163.repo

将如下的内容复制,粘贴:

# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
# 
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
# Jeson@imoocc.com
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

请关注Jeson老师近期将在慕课网推出的新课程《阿里云ECS及Centos7主机实战》。这里将介绍阿里云讲解但十分隐晦或你都不了解的,你使用但不知道的,你知道但不明白的,我课程将一一覆盖。
深度的了解最新版本Centos7.4操作系统,全面的掌控Centos7系统的所有新特性使用。
图片描述

打开App,阅读手记
6人推荐
发表评论
随时随地看视频慕课网APP

热门评论

这里最好将$releasever手动改为7,原因系统可能无法识别。

还有就是6的版本里面是空的,资源无了。

会遇到如下错误,修改完后注意清除和更新yum缓存。

Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
http://mirrors.163.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.163.com/centos/6/extras/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
http://mirrors.163.com/centos/6/updates/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: No matching Packages to list

#清除缓存

yum clean all 


#更新缓存

yum makecache


那么何时出呢?

查看全部评论