小工具知识网

当前位置: 首页 > 行业知识 > Linux yum安装pgsql出现Bad GPG signature错误

行业知识

Linux yum安装pgsql出现Bad GPG signature错误

2026-11-06 07:40:09 来源:互联网转载

官方文档:https://www.postgresql.org/download/linux/redhat/

sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpmsudo yum install -y postgresql12-serversudo /usr/pgsql-12/bin/postgresql-12-setup initdbsudo systemctl enable postgresql-12sudo systemctl start postgresql-12

按照官方文档操作执行如下命令:

sudo yum install -y postgresql12-server

提示找不到,此时需要进行如下操作:

# 查找repo文件,复制pgdg-redhat-all.repo这个文件名ls -l /etc/yum.repos.d/
# 编辑这个配置文件,将刚刚复制的文件名添加进去vim /etc/yum/pluginconf.d/releasever_adapter.conf

继续执行:sudo yum install -y postgresql12-server

出现错误:Error: Failed to download metadata for repo 'pgdg-common': repomd.xml GPG signature verification error: Bad GPG signature

此时只需要修改安装命令即可:

sudo yum install -y --nogpgcheck postgresql12-server

上一篇:宝塔面板自动备份恢复秘籍,一键解决备份恢复难题!

下一篇:网易咸鱼服务器怎么进不去?