Yum

列出將使用 yum 安裝包的儲存庫

  • June 14, 2013

我正在嘗試完全從本地儲存庫執行 yum。我如何判斷 yum 是否在使用其他儲存庫?有沒有辦法列出 yum 獲取包裹的位置?

如果您執行“yum install”並檢查輸出,它應該會為您提供它將用於安裝軟體包的儲存庫的名稱,以及它的 deps;

==================================================================================
Package            Arch            Version              Repository           Size
==================================================================================
Installing:
evolution          x86_64          3.6.4-3.fc18         updates               8.7 M
Installing for dependencies:
gtkhtml3           x86_64          4.6.4-1.fc18         updates               808 k
libytnef           x86_64          1.5-9.fc18           fedora                29 k

如果你yum deplist package這樣執行,yum 會給你一些關於它如何解決包的依賴關係的更多資訊;

$ sudo yum deplist evolution
Loaded plugins: auto-update-debuginfo, langpacks, presto
package: evolution.i686 3.6.4-3.fc18
 dependency: /bin/sh
  provider: bash.x86_64 4.2.45-1.fc18
 dependency: gnome-icon-theme >= 2.30.2.1
  provider: gnome-icon-theme.noarch 3.6.2-1.fc18
 dependency: gvfs
  provider: gvfs.x86_64 1.14.2-4.fc18
  provider: gvfs.i686 1.14.2-4.fc18
 dependency: libICE.so.6

但是,您可以強制它使用您的特定本地儲存庫,即酌情替換為您命名的本地儲存庫,並使用適當的啟用和禁用儲存庫選項禁用所有其他儲存庫--disablerepo=* --enablerepo=<your local repo here>

$ sudo yum --disablerepo=* --enablerepo=fedora install evolution
Loaded plugins: auto-update-debuginfo, langpacks, presto
Resolving Dependencies
--> Running transaction check
---> Package evolution.x86_64 0:3.6.2-3.fc18 will be installed
...
---> Package libytnef.x86_64 0:1.5-9.fc18 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
Package              Arch             Version              Repository      Size
======================================================================================
Installing:
evolution            x86_64           3.6.2-3.fc18          fedora         8.7 M
Installing for dependencies:
gtkhtml3             x86_64           4.6.1-1.fc18          fedora         806 k
libytnef             x86_64           1.5-9.fc18            fedora         29 k

Transaction Summary
======================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 9.5 M
Installed size: 47 M

最後一種方法將從命名的 repo 安裝包及其依賴項,(或失敗並顯示錯誤消息的解釋。)

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