You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS7安装EPEL后yum提示仓库重复配置问题求助

Fix "Repository epel is listed more than once in the configuration" on CentOS 7

Hey there, let's get that annoying duplicate repo error sorted out quickly. Here's a step-by-step breakdown to fix it:

1. Identify the duplicate repo entry

First, let's pin down exactly where the duplicate epel repository is defined. Run this command to list all EPEL-related repo IDs and their associated files:

sudo yum-config-manager --list | grep -A5 -B5 epel

This output will show you every repo entry linked to EPEL, including which .repo file it originates from. Keep an eye out for the same repo id (specifically epel) appearing multiple times.

Alternatively, you can check the contents of each repo file directly to spot duplicates:

# Inspect epel.repo
cat /etc/yum.repos.d/epel.repo
# Inspect epel-testing.repo
cat /etc/yum.repos.d/epel-testing.repo
# Inspect localc7.repo
cat /etc/yum.repos.d/localc7.repo

Look for duplicate [epel] sections across these files (or even within a single file).

2. Disable the duplicate entry

Once you've found the duplicate, you have two straightforward options to fix it:

Option A: Use yum-config-manager to disable it

If the duplicate repo has a unique ID (or you want to toggle off the extra one), run:

sudo yum-config-manager --disable <duplicate-repo-id>

For example, if the duplicate comes from localc7.repo and its repo ID is epel-local, you'd run:

sudo yum-config-manager --disable epel-local

Use the output from step 1 to get the exact repo ID if you're unsure.

Option B: Edit the repo file directly

Open the problematic .repo file with a text editor like nano or vi:

sudo nano /etc/yum.repos.d/[problem-file].repo

Find the duplicate [epel] section, then either:

  • Change enabled=1 to enabled=0 to disable it, or
  • Delete the entire duplicate section (just double-check you don't remove the original valid entry!)

Save the file and exit the editor when done.

3. Verify the fix

Run this command to confirm the error is resolved:

yum repolist all

You should no longer see the "Repository epel is listed more than once" message. If everything looks good, test with a command like yum update to ensure yum functions normally again.


内容的提问来源于stack exchange,提问作者ted

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:21:04