Fedora

如何手動添加 yum 儲存庫?

  • July 6, 2018

我正在嘗試通過創建文件將英特爾產品.repo儲存庫添加到 dnf,但是當我執行dnf repolist時出現此錯誤:

Failed to synchronize cache for repo 'intel-products', disabling.

我的intel-products.repo文件/etc/yum.repos.d如下所示:

[intel-products]
name=intel-products
baseurl=https://yum.repos.intel.com/setup/intelproducts.repo
enabled=1
gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

這個文件有什麼問題?

更新 1

正如評論中所建議的,我嘗試執行dnf repolist --verbose顯示:

Cannot download 'https://yum.repos.intel.com/setup/': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.

baseurl變數更改為 url 的完整路徑後,我得到相同的結果:

Cannot download 'https://yum.repos.intel.com/setup/intelproducts.repo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors w
ere tried

更新 2:

輸出curl https://yum.repos.intel.com/setup/intelproducts.repo

[intel-ipp-repo]
name=Intel(R) Integrated Performance Primitives
baseurl=https://yum.repos.intel.com/ipp
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

[intel-mkl-repo]
name=Intel(R) Math Kernel Library
baseurl=https://yum.repos.intel.com/mkl
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

[intel-tbb-repo]
name=Intel(R) Threading Building Blocks
baseurl=https://yum.repos.intel.com/tbb
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

[intel-mpi-repo]
name=Intel(R) MPI Library
baseurl=https://yum.repos.intel.com/mpi
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB

我需要使用英特爾創建的完全相同的.repo文件,因為我不知道他們如何定義文件中的變數和值。為此,我使用 curl 的輸出到標準輸出:

curl https://yum.repos.intel.com/setup/intelproducts.repo | cat > intel-products.repo

baseurl的不正確,它應該指向一個帶有 repomd.xml 而不是 .repo 文件的儲存庫。

嘗試:

curl https://yum.repos.intel.com/setup/intelproducts.repo > /etc/yum.repos.d/intel-products.repo; dnf repolist

看看是否效果更好

引用自:https://unix.stackexchange.com/questions/453048