CentOS Repository epel is listed more than once in the configuration

在使用 yum 如果出現以下提示,一般是設置了多個 epel 倉庫:

Repository epel is listed more than once in the configuration

倉庫列表位於 /etc/yum.repos.d/

1$ ls -l /etc/yum.repos.d/ | grep pel
2-rw-r--r-- 1 root root  230 Jan  8 11:29 CentOS-Epel.repo
3-rw-r--r-- 1 root root 1050 Sep 18 07:25 epel.repo
4-rw-r--r-- 1 root root 1149 Sep 18 07:25 epel-testing.repo

可以看到系統有多個 epel 的倉庫,我們逐一檢查:

1$ cat /etc/yum.repos.d/CentOS-Epel.repo
2[epel]
3...
1$ cat /etc/yum.repos.d/epel.repo
2[epel]
3...

然後把多餘的 [epel] 註釋或者刪除即可。