我正在开发一个 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:
Run Code Online (Sandbox Code Playgroud)
现在我的项目可以编译,但不会与缺少的引用链接:
/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'
Run Code Online (Sandbox Code Playgroud)
这很可能意味着,有些包被混淆了:有些是从一个 repo 安装的,有些是从另一个 repo 安装的。
问题:(i) 我如何告诉 yum 从一个 repo 安装软件包,然后从另一个 repo 重新安装(看看链接错误是否会消失);(ii) 如何查看系统上的哪些软件包是从一个 repo 安装的,以及从另一个 repo 安装的?
要从其中安装一个软件包,请排除 /etc/yum.repos.d/epel 或 /etc/yum.repos.d/rpmforge 文件中的软件包。
exclude= <包名>
添加在最后,您可以根据需要添加多行。
安装的软件包应该在 /var/log/yum.log 中列出
yum list installed
会告诉你从哪个仓库安装了给定的包,例如:
bonnie++.x86_64 1.96-2.el6 @epel/6.2
Run Code Online (Sandbox Code Playgroud)
要选择要安装的变体,只需使用您要从whatprovides
列表中安装的变体的确切名称:
yum install postgis-1.3.6-1.el6.rf.x86_64
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅specify package names
部分man yum
。