刹那的菜鸟

博客园 首页 新随笔 联系 管理
  213 随笔 :: 13 文章 :: 21 评论 :: 30万 阅读

/etc/yum.repos.d/CentOS-Base.repo 是设置具体的镜像源
复制整个命令块,从 cat > 开始,一直到最后的 EOF。

将整个命令块粘贴到终端中。

按 Enter 键。

如果一切正常,命令会自动执行,并创建(或覆盖)文件 /etc/yum.repos.d/CentOS-Base.repo。

命令执行完毕后,你会回到正常的命令提示符。

`
cat > /etc/yum.repos.d/CentOS-Base.repo << 'EOF'

CentOS-Base.repo

The mirror system uses the connecting IP address of the client and the

update status of each mirror to pick mirrors that are updated to and

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.

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
EOF
`

要记得使用notepad++ 编码设置utf8 才好

posted on   刹那的菜鸟  阅读(302)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
历史上的今天:
2017-07-10 net core 获取网站目录
2016-07-10 SOD 精选细节--常用工具
点击右上角即可分享
微信分享提示