官方文檔: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
按照官方文檔操作執(zhí)行如下命令:
sudo yum install -y postgresql12-server
提示找不到,此時需要進行如下操作:
# 查找repo文件,復(fù)制pgdg-redhat-all.repo這個文件名
ls -l /etc/yum.repos.d/
# 編輯這個配置文件,將剛剛復(fù)制的文件名添加進去
vim /etc/yum/pluginconf.d/releasever_adapter.conf
繼續(xù)執(zhí)行:sudo yum install -y postgresql12-server
出現(xiàn)錯誤:Error: Failed to download metadata for repo 'pgdg-common': repomd.xml GPG signature verification error: Bad GPG signature文章來源:http://www.zghlxwxcb.cn/news/detail-849523.html
此時只需要修改安裝命令即可:文章來源地址http://www.zghlxwxcb.cn/news/detail-849523.html
sudo yum install -y --nogpgcheck postgresql12-server
到了這里,關(guān)于Linux yum安裝pgsql出現(xiàn)Bad GPG signature錯誤的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!