Postgresql

嘗試更新 postgresql-libs 時出錯

  • January 24, 2012

當我這樣做時,yum update我收到以下錯誤:

Transaction Check Error:
 file /usr/lib64/libecpg.so.6.1 from install of postgresql-libs-8.4.10-1PGDG.rhel5.x86_64 conflicts with file from package postgresql84-libs-8.4.9-1.el5_7.1.x86_64
 file /usr/lib64/libecpg_compat.so.3.1 from install of postgresql-libs-8.4.10-1PGDG.rhel5.x86_64 conflicts with file from package postgresql84-libs-8.4.9-1.el5_7.1.x86_64
 file /usr/lib64/libpgtypes.so.3.1 from install of postgresql-libs-8.4.10-1PGDG.rhel5.x86_64 conflicts with file from package postgresql84-libs-8.4.9-1.el5_7.1.x86_64
 file /usr/lib64/libpq.so.5.2 from install of postgresql-libs-8.4.10-1PGDG.rhel5.x86_64 conflicts with file from package postgresql84-libs-8.4.9-1.el5_7.1.x86_64
 file /usr/share/locale/pl/LC_MESSAGES/libpq5-8.4.mo from install of postgresql-libs-8.4.10-1PGDG.rhel5.x86_64 conflicts with file from package postgresql84-libs-8.4.9-1.el5_7.1.x86_64
 file /usr/share/locale/pl/LC_MESSAGES/libpq5-8.4.mo from install of postgresql-libs-8.4.10-1PGDG.rhel5.x86_64 conflicts with file from package postgresql84-libs-8.4.9-1.el5_7.1.i386

我現在知道它是如何發生衝突的,因為我已經使用yum.

但沒關係。

但我不知道如何解決這些問題以便能夠更新 pgsql 庫。

有一個類似的問題,但這是關於 i386 與 x86_64 版本的安裝。

那麼……如何解決這個問題?

編輯

根據要求,yum 的 repolist:

repo id           repo name                                             status
addons            CentOS-5 - Addons                                            0
base              CentOS-5 - Base                                        3,558+8
epel              Extra Packages for Enterprise Linux 5 - x86_64           6,808
extras            CentOS-5 - Extras                                          269
ius               IUS Community Packages for Enterprise Linux 5 - x86_6      149
kbs-CentOS-Extras CentOS.Karan.Org-EL5 - Stable                                0
kbs-CentOS-Misc   CentOS.Karan.Org-EL5 - Stable                                0
pgdg84            PostgreSQL 8.4 5 - x86_64                                  161
rpmforge          Red Hat Enterprise 5 - RPMforge.net - dag             10,899+1
updates           CentOS-5 - Updates                                      442+24

看起來您安裝的 postgresql 版本來自 yum.postgresql.org,並且 yum 正在嘗試從 centos 儲存庫更新 postgresql。如果是這種情況,您是否嘗試在文件exclude=postgresql*的相應部分添加一行/etc/yum.repos.d/CentOS*.repo

例如(來自 /etc/yum.repos.d/CentOS-Base.repo):

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
exclude=postgresql*

#released updates 
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
exclude=postgresql*

更新 看起來你的yum repolist輸出證實了我的預感……你需要告訴 yum 不要安裝/更新/使用來自 CentOS 儲存庫的 postgresql84 軟體包。將排除語句添加到 CentOS-Base.repo 文件的基本和更新部分,您應該已設置好。

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