Linux yum安装postgresql出现Bad GPG signature问题的解决方法

来自:网络
时间:2024-06-08
阅读:

官方文档: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.rpm
sudo yum install -y postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo systemctl enable postgresql-12
sudo systemctl start postgresql-12

安装官方文档操作执行如下命令:

sudo yum install -y postgresql12-server

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

# 查找repo文件,复制pgdg-redhat-all.repo这个文件名
ls -l /etc/yum.repos.d/

Linux yum安装postgresql出现Bad GPG signature问题的解决方法

# 编辑这个配置文件,将刚刚复制的文件名添加进去
vim /etc/yum/pluginconf.d/releasever_adapter.conf

Linux yum安装postgresql出现Bad GPG signature问题的解决方法

继续执行: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
返回顶部
顶部