GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022"
现象
yum安装MySQL报错:
1 | GPG key retrieval failed: [Errno 14] curl#37 - "Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql-2022" |
安装过程:
1 2 3 4 5 6 | rpm -Uvh https://repo.mysql.com//mysql80-community-release-el7.rpm yum-config-manager --disable mysql80-community yum-config-manager --enable mysql57-community yum install -y mysql-community-server |
解决
方法1:
需要先运行下面的命令
1 | rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 |
方法2:
vi /etc/yum.repo/mysql-community.repo
将gpgcheck=1
修改为:gpgcheck=0
1 | sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/mysql-community.repo |