Skip to content

Commit

Permalink
update the help of epel (close tuna/issues#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
z4yx committed Feb 1, 2020
1 parent 490d6f6 commit f70ca17
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions _posts/help/1970-01-01-epel.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@ yum install epel-release
```

当前tuna已经在epel的官方镜像列表里,所以不需要其他配置,mirrorlist机制就能让你的服务器就近使用tuna的镜像。如果你想强制
你的服务器使用tuna的镜像,可以修改`/etc/yum.repos.d/epel.repo`,将`baseurl`开头的行取消注释(删掉`#`),并注释`mirrorlist`
开头的行(在头部加一个`#`)。
你的服务器使用tuna的镜像,可以修改`/etc/yum.repos.d/epel.repo`,将`mirrorlist``metalink`开头的行取消注释(删掉`#`)。

接下来,把这个文件里的`http://download.fedoraproject.org/pub`替换成`https://mirrors.tuna.tsinghua.edu.cn`即可。
接下来,把这个文件里`baseurl`开头的行里的`http://download.fedoraproject.org/pub`替换成`https://mirrors.tuna.tsinghua.edu.cn`即可。

修改结果如下
可以用如下命令自动替换:(来自 https://github.com/tuna/issues/issues/687)

```
sed -e 's!^metalink=!#metalink=!g' \
-e 's!^#baseurl=!baseurl=!g' \
-e 's!//download\.fedoraproject\.org/pub!//mirrors.tuna.tsinghua.edu.cn!g' \
-e 's!http://mirrors\.tuna!https://mirrors.tuna!g' \
-i /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo
```

修改结果如下:(仅供参考,不同版本可能不同)

```
[epel]
Expand Down

0 comments on commit f70ca17

Please sign in to comment.