LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 05-11-2020, 02:32 AM   #1
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Rep: Reputation: Disabled
Failed to search for file: Failed to download gpg key for repo 'mariadb-main': Curl error (37) showing up in terminal


I installed MariaDB on a computer with CentOS using the instructions given here: https://mariadb.com/kb/en/mariadb-pa...tup-and-usage/

The basic command I used was
Code:
sudo yum install MariaDB-server MariaDB-client
and I did not install Maxscale or percona

Mariadb installed successfully, but now when I go to the terminal and type in a command that doesn't exist, I get a "Failed to download gpg key" error message.

For example, when I type in ftp and press enter, previously I would have got a message indicating that ftp was not installed, and I would have got some recommendations on which command I meant and would like to download. However, now I get this:

Code:
[username@localhost ~]$ ftp  
bash: ftp: command not found...  
Failed to search for file: Failed to download gpg key for repo 'mariadb-main': Curl error (37):     Couldn't read a file:// file for file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY [Couldn't open file   /etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY]  
[username@localhost ~]$
I understand this is because because the file etc/yum.repos.d/maradb.repo has an entry gpgkey = file:///etc/pki/rpm-gpg/MariaDB-Server-GPG-KEY and the MariaDB-Server-GPG-KEY file does not exist in etc/pki/rpm-gpg

I think this file should have been copied to this location automatically when I installed Mariadb, but didn't for some reason. Is there a way I can create or download this file manually to make this error message go away?
 
Old 05-11-2020, 02:36 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Code:
sudo rpm --import https://downloads.mariadb.com/MariaDB/MariaDB-Server-GPG-KEY
 
Old 05-11-2020, 02:51 AM   #3
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
Code:
sudo rpm --import https://downloads.mariadb.com/MariaDB/MariaDB-Server-GPG-KEY
I still get the same error. etc/pki/rpm-gpg does not have the MariaDB-Server-GPG-KEY file. Opening https://downloads.mariadb.com/MariaD...Server-GPG-KEY in browser gives me a 404 not found page
 
Old 05-11-2020, 02:55 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Check your internet connection then. I can download it no problem. Does this also not work?
Code:
sudo rpmkeys --import https://downloads.mariadb.com/MariaDB/RPM-GPG-KEY-MariaDB
 
Old 05-11-2020, 03:05 AM   #5
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
Check your internet connection then. I can download it no problem. Does this also not work?
Code:
sudo rpmkeys --import https://downloads.mariadb.com/MariaDB/RPM-GPG-KEY-MariaDB
This command doesn't return anything but I still get the GPG file not found error.

Incidentally I was able to download the MariaDB-Server-GPG-KEY from a browser, I'm not sure why it didn't work earlier. But I have this file now. Can I simply copy it into /etc/pki/rpm-gpg ?
 
Old 05-11-2020, 03:06 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
No, better install it properly
Code:
sudo rpmkeys --import MariaDB-Server-GPG-KEY
 
Old 05-11-2020, 03:18 AM   #7
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
No, better install it properly
Code:
sudo rpmkeys --import MariaDB-Server-GPG-KEY
This gives me
Code:
error: MariaDB-Server-GPG-KEY: import read failed(2).
 
Old 05-11-2020, 03:22 AM   #8
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
I get this error message when trying to import a key from a non-existing file. Have you run it from the same directory where you downloaded the key? If not then it should have been
Code:
sudo rpmkeys --import /path/to/the/downloaded/MariaDB-Server-GPG-KEY
 
Old 05-11-2020, 03:33 AM   #9
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
I get this error message when trying to import a key from a non-existing file. Have you run it from the same directory where you downloaded the key? If not then it should have been
Code:
sudo rpmkeys --import /path/to/the/downloaded/MariaDB-Server-GPG-KEY
I changed to the folder where I downloaded the MariaDB-Server-GPG-KEY file and tried sudo rpmkeys --import MariaDB-Server-GPG-KEY

The command does not return any errors but I still get the "Failed to download GPG error"

The /etc/pki/rpm-gng folder still does not have a MariaDB-Server-GPG-KEY file
 
Old 05-11-2020, 03:49 AM   #10
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Then just put this into /etc/yum.repos.d/mariadb.repo
Code:
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
 
Old 05-11-2020, 04:12 AM   #11
mahaju
Member
 
Registered: Nov 2011
Posts: 39

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
Then just put this into /etc/yum.repos.d/mariadb.repo
Code:
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Is it safe to do this? What is the difference between RPM-GPG-KEY-MariaDB and MariaDB-Server-GPG-KEY? What is it actually doing internally?
 
Old 05-11-2020, 04:16 AM   #12
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
I just copied it from their repository generator, so I suppose it's safe.
 
  


Reply

Tags
centos, gpg, package management, rpm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 10:06 AM
Import private key generated from gpg 2.2.10 into gpg 2.0.31 john2x Slackware 0 10-29-2018 03:44 PM
[SOLVED] gen_repos_files doesn't use the repo's owner GPG key to sign packages cendryon Slackware 7 08-01-2014 01:34 AM
[SOLVED] ./curl -V showing fatal: libldap.so.5: open failed: No such file or directory manalisharmabe Solaris / OpenSolaris 9 09-09-2013 12:56 PM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration