Question

Error installing mariadb on centos 8 droplet

As I follow the tutorial for install mariadb on centos 8 (https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-centos-8) the dnf install command has repeatedly failed. The files download but the install fails and I think it’s because of an issue with the signature. I get the following back each time I run the dnf install:

error: /var/cache/dnf/appstream-670736f27949a722/packages/perl-DBI-1.641-4.module_el8+332+132e4365.x86_64.rpm: signature hdr data: BAD, no. of bytes(30020) out of range
error: /var/cache/dnf/appstream-670736f27949a722/packages/perl-IO-Socket-SSL-2.066-4.module_el8+339+1ec643e0.noarch.rpm: signature hdr data: BAD, no. of bytes(11548) out of range
error: /var/cache/dnf/appstream-670736f27949a722/packages/perl-Net-SSLeay-1.88-2.module_el8+339+1ec643e0.x86_64.rpm: signature hdr data: BAD, no. of bytes(28456) out of range
Problem opening package perl-DBI-1.641-4.module_el8+332+132e4365.x86_64.rpm
Problem opening package perl-IO-Socket-SSL-2.066-4.module_el8+339+1ec643e0.noarch.rpm
Problem opening package perl-Net-SSLeay-1.88-2.module_el8+339+1ec643e0.x86_64.rpm
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

I’ve done some searching but so far found nothing to help resolve the error. Any guidance would be greatly appreciated.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
May 27, 2023
Pinned Answer

Hey @bross68,

This issue is because there is a difference between the RPM package that you have and the one that your system is trying to use.

The solution is detailed in both these topics:

https://www.digitalocean.com/community/questions/centos-8-update-fail-with-error-problem-opening-package

https://www.digitalocean.com/community/questions/cento-os-8-not-updating

Basically, you need to run the following commands as it follows:

  1. dnf clean all
  2. dnf update rpm
  3. dnf update

Once the above 3 commands have been executed in that order you can try installing mariadb.

alexdo
Site Moderator
Site Moderator badge
May 27, 2023

Hello @bross68

This issue might be related to corrupted or outdated packages in the cache. To resolve this error, please follow these steps:

  1. Clean the DNF cache: Run the following command to remove cached packages and metadata:
  1. sudo dnf clean all
  1. Re-import the GPG key: If the GPG key is causing the issue, re-import it using this command:
  1. sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
  1. Update your system: Ensure that your system is up-to-date with the latest packages and dependencies by running:
  1. sudo dnf update -y
  1. Try the installation again: After completing the steps above, retry the installation of MariaDB following the tutorial.

If the issue persists, please ensure that you have correctly configured repositories and there are no network connectivity issues.

For more information on installing MariaDB on CentOS 8, please refer to this tutorial: How To Install MariaDB on CentOS 8.

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more