Repository updates is listed more than once in the configuration問題的解決方法


這種情況會出現在你配置多個源的時候,直接用官網上源的配置方法配置多個源不做修改就會出現這個問題

Repository updates is listed more than once in the configuration Repository updates-debuginfo is listed more than once in the configuration Repository updates-source is listed more than once in the configuration Repository fedora is listed more than once in the configuration Repository fedora-debuginfo is listed more than once in the configuration Repository fedora-source is listed more than once in the configuration

 

 原因也很簡單,從上面的提示就可以看出來在某個配置(configuration)文件里updates, updates-debuginfo , updates-source等出現了不只一次,所以我們很自然的想到觀察一下這些源的相關配置

回想到我們在配置源的時候只用到了.repo結尾的文件,所以我們從自己配置的.repo 文件中尋找出路

執行下列指令

 cat /etc/yum.repos.d/fedora-updates.repo 

你會發現類似以下輸出(因為我的fedora-updates.repo是阿里的所以你的輸出會和我的有一些區別)

[updates] name=Fedora $releasever - $basearch - Updates - aliyun failovermethod=priority baseurl=http://mirrors.aliyun.com/fedora/updates/$releasever/$basearch/ 
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch 
enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch 
 [updates-debuginfo] name=Fedora $releasever - $basearch - Updates - Debug -aliyun failovermethod=priority baseurl=http://mirrors.aliyun.com/fedora/updates/$releasever/$basearch/debug/ 
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch 
enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch 
 [updates-source] name=Fedora $releasever - Updates Source - aliyun failovermethod=priority baseurl=http://mirrors.aliyun.com/fedora/updates/$releasever/SRPMS/ 
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch 
enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch 

 

觀察每一段的開頭就可以發現,每一段開頭中括號里的內容就是上述列出的單詞,當你在查看其他*-updates.repo文件時可以發現同樣的輸出,這便是症結所在

解決的方法也很簡單就是把這些段落開頭的中括號里的內容修改一下,比如我的中科大源的更新的配置(fedora-ustc-updates.repo)

[updates-ustc] name=Fedora $releasever - $basearch - Updates - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/fedora/updates/$releasever/$basearch/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1 repo_gpgcheck=0 type=rpm gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False [updates-ustc-debuginfo] name=Fedora $releasever - $basearch - Updates - Debug - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/fedora/updates/$releasever/Everything/$basearch/debug/tree/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
enabled=0 repo_gpgcheck=0 type=rpm gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False [updates-ustc-source] name=Fedora $releasever - Updates Source - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/fedora/updates/$releasever/Everything/source/tree/
#metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch
enabled=0 repo_gpgcheck=0 type=rpm gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

 

只是把段落開頭的中括號里的updates改為updates-ustc 把updates-debuginfo改為updates-ustc-debuginfo等,如果你還有其他源也可以這樣修改就行了

全部修改完畢后更新一下就好

 sudo dnf makecache 

另外中科大源的更新有點小問題,下一篇文章會記錄下來。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM