Yum

yum:兩個儲存庫中的相同包,強制從不同的儲存庫安裝包

  • February 8, 2013

我正在開發一個 PostgresDB 外掛。該外掛在 Centos 6.3 的 Postgres 中執行。為了能夠編譯我的項目,我必須安裝一些來自 epel 儲存庫的庫和一些來自 rpmforge 的庫。有趣的是,一些軟體包在兩個儲存庫中都重複了,例如:

# yum whatprovides postgis

Loaded plugins: fastestmirror, presto, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
* Webmin: download.webmin.com
* base: mirror2.hs-esslingen.de
* epel: mirror.awanti.com
* extras: mirror2.hs-esslingen.de
* rpmforge: mirror.nl.leaseweb.net
* updates: mirror.netcologne.de
postgis-1.5.3-1.el6.x86_64 : Geographic Information Systems Extensions to
                          : PostgreSQL
Repo        : epel
Matched from:



postgis-1.3.6-1.el6.rf.x86_64 : Geographic Information Systems Extensions to
                             : PostgreSQL
Repo        : rpmforge
Matched from:

現在我的項目編譯了,但沒有連結到缺少的引用:

/usr/pgsql-9.1/lib/postgis-1.5.so: undefined reference to `accumArrayResult'
/usr/pgsql-9.1/lib/postgis-1.5.so: undefined reference to `TupleDescGetAttInMetadata'
/usr/pgsql-9.1/lib/postgis-1.5.so: undefined reference to `repalloc'
/usr/pgsql-9.1/lib/postgis-1.5.so: undefined reference to `SPI_exec'
/usr/pgsql-9.1/lib/postgis-1.5.so: undefined reference to `init_MultiFuncCall'

這很可能意味著一些軟體包混淆了:一些是從一個 repo 安裝的,有些是從另一個 repo 安裝的。

問題:(i)我如何告訴 yum 從一個倉庫安裝軟體包,然後從另一個倉庫重新安裝(查看連結錯誤是否會消失);(ii) 如何查看系統上的哪些軟體包是從一個儲存庫安裝的,以及從另一個儲存庫安裝的軟體包?

yum list installed將告訴您從哪個倉庫安裝了給定的軟體包,例如:

bonnie++.x86_64                     1.96-2.el6                  @epel/6.2  

要選擇要安裝的變體,只需使用列表中要安裝的變體的確切名稱whatprovides

yum install postgis-1.3.6-1.el6.rf.x86_64

有關詳細資訊,請參閱 的specify package names部分man yum

要從其中安裝一個包,請排除 /etc/yum.repos.d/epel 或 /etc/yum.repos.d/rpmforge 文件中的包。

排除= <包名>

最後添加,您可以根據需要添加多行。

安裝的軟體包應該在 /var/log/yum.log 中列出

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