CentOS public key installation

Please write your question in detail here.
(Example) I am making a ●● system with PHP (CakePHP).
The following error message occurred while implementing the ■■ function.

Error message
Import cannot be read even if the command for installing the public key is written as follows
Applicable source code
$sudo rpm --import/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Error:/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7: Import reading failed (2).

-Create public and private keys using teraterm.
・ I wonder if the version of CentOS is different $sudo rpm --import/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
I tried to change CentOS-7 to CentOS-8.

Supplemental information (FW/tool version etc.)

The CentOS version I am currently using is CentOS8.
I would like to install the package after this.
By the way, the OS I use is Windows

  • Answer # 1

    Did you try to install the GPG key according to the Qiita page?

    For CentOS8,
    / etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    Also called
    / etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-8
    There is no file called.

    There are
    / etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
    It is a file called. Please use this.

  • Answer # 2

    CentOS GPG Keys
    If you download the CentOS8 key here, you can install the CentOS official key.

    If you want to import what you created yourself, you must of course specify the key file path.