Linux

cobbler 無法同步到我添加的 repo

  • July 25, 2017

我將 centos 基礎 repo 添加到 cobbler:

cobbler repo add --arch=x86_64 --name=Centos-Base --mirror=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

但執行 cobbler reposync 失敗:

received on stderr: Traceback (most recent call last):
 File "/usr/bin/reposync", line 343, in <module>
   main()
 File "/usr/bin/reposync", line 175, in main
   my.doRepoSetup()
 File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 681, in doRepoSetup
   return self._getRepos(thisrepo, True)
 File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 721, in _getRepos
   self._repos.doSetup(thisrepo)
 File "/usr/lib/python2.7/site-packages/yum/repos.py", line 157, in doSetup
   self.retrieveAllMD()
 File "/usr/lib/python2.7/site-packages/yum/repos.py", line 88, in retrieveAllMD
   dl = repo._async and repo._commonLoadRepoXML(repo)
 File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1470, in _commonLoadRepoXML
   result = self._getFileRepoXML(local, text)
 File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1248, in _getFileRepoXML
   size=102400) # setting max size as 100K
 File "/usr/lib/python2.7/site-packages/yum/yumRepo.py", line 1037, in _getFile
   raise e
yum.Errors.NoMoreMirrorsRepoError: failure: repodata/repomd.xml from Centos-Base: [Errno 256] No more mirrors to try.
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for Centos-Base: Damaged repomd.xml file

這不是那樣工作的,因為 Cobbler 無法處理鏡像列表功能。該--mirror選項必須指定您要從中下載儲存庫的特定 URL。

引用自:https://serverfault.com/questions/865048