在 CentOS7 上安装 postgresql11 时出现异常的存储库错误

在 CentOS7 上安装 postgresql11 时出现异常的存储库错误

我尝试在 CentOS7 上安装 postgresql11。我在官方网站上找到了安装说明: https://www.postgresql.org/download/linux/redhat/

然后我按照它的步骤并选择以下参数:

1.version: 11
2.platform: RedHat Enterprise,CentOS, Scientific or Oracle version 7
3.architecture: x86_64

获取安装资源 RPM 的命令:

yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

我在服务器上运行成功。然后我尝试运行命令来安装客户端软件包:

yum install postgresql11

当我执行此命令时,出现以下错误:

File contains parsing errors: file:///etc/yum.repos.d/pgdg-redhat-all.repo
    [line 196]: [pgdg96-updates-debuginfo]k
    [line 203]: [pgdg95-updates-debuginfo]k

当我尝试删除此包时遇到同样的错误使用命令:

yum erase pgdg-redhat-repo

我在 /etc/yum.repos.d 使用命令中找不到任何内容:

cd /etc/yum.repos.d/ && grep pgdg-redhat-all.repo ./*

我已经在谷歌中搜索过这个错误,似乎没有人遇到这个错误。有谁知道如何解决这个问题?

答案1

他们在准备该 rpm 时似乎犯了一个包装错误。在 中/etc/yum.repos.d/pgdg-redhat-all.repo,您会找到一个部分

[pgdg10-updates-debuginfo]
name=PostgreSQL 10 for RHEL/CentOS $releasever - $basearch - Debuginfo
baseurl=https://download.postgresql.org/pub/repos/yum/debug/10/redhat/rhel-$releasever-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG

[pgdg96-updates-debuginfo]k
name=PostgreSQL 9.6 for RHEL/CentOS $releasever - $basearch - Debuginfo
baseurl=https://download.postgresql.org/pub/repos/yum/debug/9.6/redhat/rhel-$releasever-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG

[pgdg95-updates-debuginfo]k
name=PostgreSQL 9.5 for RHEL/CentOS $releasever - $basearch - Debuginfo
baseurl=https://download.postgresql.org/pub/repos/yum/debug/9.5/redhat/rhel-$releasever-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG

# Debuginfo/debugsource packages for testing repos
# Available for 9.6 and above.

只要删除k后面的 s]就可以了。此错误已被报告

相关内容