不能在Centos 6上安装PostgreSQL 9服务器

不能在Centos机器上安装PostgreSQL服务器。

我只是添加了PostgreSQL官方回购

rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-3.noarch.rpm 

然后跑了

 yum install yum install postgresql95-server 

这是我得到的错误:

 Error unpacking rpm package postgresql95-server-9.5.9-1PGDG.rhel6.x86_64 error: unpacking of archive failed on file /var/lib/pgsql: cpio: stat 

我试过PostgreSQL 9.4,9.5,9.6,他们都有相同的错误。

也从这个回购其他包安装没有任何问题

有人知道这里有什么问题吗?

尝试在本地下载软件包,然后安装。 但要注意你正在下载的版本。

引自https://www.postgresql.org/download/linux/redhat/

  发行版本 
  RHEL / CentOS / SL / OL 7 9.2 
  RHEL / CentOS / SL / OL 6 8.4 
  RHEL / CentOS / SL / OL 5 8.1 

抱歉上面的格式。 这是我们在这里有限的工具所能做的最好的。

假设你是root用户,并且没有任何selinux问题,你可能在yum试图安装postgres的系统上有一些以前剩余的文件。

我刚刚完成了你所说的那样,在一个干净的C6安装,它工作正常:

 [me@angband ~]$ sudo rpm -ivh https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-3.noarch.rpm Retrieving https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-3.noarch.rpm warning: /var/tmp/rpm-tmp.YH2GD1: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY Preparing... ########################################### [100%] 1:pgdg-centos95 ########################################### [100%] [me@angband ~]$ sudo yum install postgresql95-server [...] Resolving Dependencies --> Running transaction check ---> Package postgresql95-server.x86_64 0:9.5.9-1PGDG.rhel6 will be installed --> Processing Dependency: postgresql95-libs(x86-64) = 9.5.9-1PGDG.rhel6 for package: postgresql95-server-9.5.9-1PGDG.rhel6.x86_64 --> Processing Dependency: postgresql95(x86-64) = 9.5.9-1PGDG.rhel6 for package: postgresql95-server-9.5.9-1PGDG.rhel6.x86_64 --> Processing Dependency: postgresql95 = 9.5.9-1PGDG.rhel6 for package: postgresql95-server-9.5.9-1PGDG.rhel6.x86_64 --> Running transaction check ---> Package postgresql95.x86_64 0:9.5.9-1PGDG.rhel6 will be installed ---> Package postgresql95-libs.x86_64 0:9.5.9-1PGDG.rhel6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================ Package Arch Version Repository Size ================================================================================================================ Installing: postgresql95-server x86_64 9.5.9-1PGDG.rhel6 pgdg95 4.5 M Installing for dependencies: postgresql95 x86_64 9.5.9-1PGDG.rhel6 pgdg95 1.3 M postgresql95-libs x86_64 9.5.9-1PGDG.rhel6 pgdg95 208 k Transaction Summary ================================================================================================================ Install 3 Package(s) Total download size: 6.0 M Installed size: 24 M Is this ok [y/N]: y [...] Running Transaction Test Transaction Test Succeeded Running Transaction Warning: RPMDB altered outside of yum. Installing : postgresql95-libs-9.5.9-1PGDG.rhel6.x86_64 1/3 Installing : postgresql95-9.5.9-1PGDG.rhel6.x86_64 2/3 Installing : postgresql95-server-9.5.9-1PGDG.rhel6.x86_64 3/3 Verifying : postgresql95-libs-9.5.9-1PGDG.rhel6.x86_64 1/3 Verifying : postgresql95-9.5.9-1PGDG.rhel6.x86_64 2/3 Verifying : postgresql95-server-9.5.9-1PGDG.rhel6.x86_64 3/3 Installed: postgresql95-server.x86_64 0:9.5.9-1PGDG.rhel6 Dependency Installed: postgresql95.x86_64 0:9.5.9-1PGDG.rhel6 postgresql95-libs.x86_64 0:9.5.9-1PGDG.rhel6 Complete! 

所以我不认为你正在尝试做任何琐碎的事情,而且似乎最有可能的是,RPM在传输过程中发生了某种改变,或者你的RPM环境不起作用。 你是否使用任何一种代理进行networking访问,并确认在yum clean all后错误仍然存​​在? 你可以尝试安装一个非常小的和无害的RPM,说yum install rcs ,并看看是否也失败了?