Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epel的提示不对 #687

Closed
qwfys opened this issue Jan 1, 2020 · 3 comments
Closed

epel的提示不对 #687

qwfys opened this issue Jan 1, 2020 · 3 comments

Comments

@qwfys
Copy link

qwfys commented Jan 1, 2020

  地址https://mirrors.tuna.tsinghua.edu.cn/help/epel/提到:
用命令yum install epel-release安装'epel-release'后,需要将baseurl开头的行取消注释,并将mirrorlist 开头的行注释掉。但问题是用命令yum install epel-release安装'epel-release'后,会在目录/etc/yum.repos.d下生成文件epel.repo与epel-testing.repo,里面都没有mirrorlist 开头的行,有的是metalink开头的行,所以,需要将metalink开头的行注释掉。具体来说,用下面的命令来替换就可以了。

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
@phy25
Copy link

phy25 commented Jan 1, 2020

你可以对 https://github.com/tuna/mirror-web/blob/master/_posts/help/1970-01-01-epel.md 这个文件提出 Pull Request。

@iamid0
Copy link

iamid0 commented Dec 17, 2021

I find the following code
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
fails on centOS8 Stream.

The original epel.repo reads like,

#baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir

Running the above mentioned code, giving out the following contents,

baseurl=https://download.example/pub/epel/$releasever/Everything/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir

Obviously, the created epel.repo will not work.

ZenithalHourlyRate added a commit to tuna/mirror-web that referenced this issue Dec 17, 2021
@ZenithalHourlyRate
Copy link
Contributor

I find the following code fails on centOS8 Stream.

Fixed

echoker added a commit to echoker/mirror-web that referenced this issue Apr 8, 2023
CentOS 8的epel-release的链接均为https,而不是http,这个在之前的[issue](tuna/issues#687 (comment) 7中均为http,所以两个版本需要不同的替换命令

并且CentOS 8的epel-release经过多次更新,
最初baseurl中的链接为https://download.fedoraproject.org,后续被修改为https://download.example,为了适配旧版本需要两个都写
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants