刹那的菜鸟

博客园 首页 新随笔 联系 管理

/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 2024-07-10 14:50  刹那的菜鸟  阅读(19)  评论(0编辑  收藏  举报