Skip to content

Ercan Ermis

notes for everyone

Menu
  • AWS
  • Kubernetes
  • Linux
  • DevOps
  • Docker
  • GCP
  • Uncategorized
  • Contact Me
Menu

Fix “Error: rpmdb open failed” on CentOS or Amazon Linux 2

Posted on April 20, 2020April 24, 2021 by Ercan

Yesterday, I have started to test some services on running Amazon Linux 2 powered by Amazon Web Services cloud. For some reason, my package manager yum is broken and when I started to update my yum database, I’ve got an error about rpmdb open failed. You can see my error below. If you are running on Centos7 or another Linux distro using the package manager as yum, you can also continue to read.

error: rpmdb: BDB0113 Thread/process 18275/140171317404864 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 -  (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

I decided to move all rpm database packages to /tmp directory.

sudo mv /var/lib/rpm/__db* /tmp

After this movement, yum should be clean completely. I run “yum clean all” to clean my yum database.

sudo yum clean all

After the cleaning process, yum said to me, cleaning is done.

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Repository elastic-7.x is listed more than once in the configuration
Bad id for repo: [email protected] yum.repos.d, byte = @ 4
Cleaning repos: amzn2-core amzn2extra-epel elastic-7.x epel treasuredata
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos

I crossed my fingers and tried to update my yum database with the latest versions of packages. For this; I run “sudo yum update” command.

sudo yum update

Now, yum is running perfectly again!

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Repository elastic-7.x is listed more than once in the configuration
Bad id for repo: [email protected] yum.repos.d, byte = @ 4
amzn2-core                                                                      | 2.4 kB  00:00:00
amzn2extra-epel                                                                 | 1.3 kB  00:00:00
elastic-7.x                                                                     | 1.3 kB  00:00:00
epel/x86_64/metalink                                                            |  21 kB  00:00:00
epel                                                                            | 4.7 kB  00:00:00
treasuredata                                                                    | 2.9 kB  00:00:00
(1/9): amzn2-core/2/x86_64/group_gz                                             | 2.5 kB  00:00:00
(2/9): amzn2-core/2/x86_64/updateinfo                                           | 200 kB  00:00:00
(3/9): amzn2extra-epel/2/x86_64/primary_db                                      | 1.8 kB  00:00:00
(4/9): elastic-7.x/primary                                                      | 115 kB  00:00:00
(5/9): epel/x86_64/group_gz                                                     |  95 kB  00:00:00
(6/9): epel/x86_64/updateinfo                                                   | 1.0 MB  00:00:00
(7/9): epel/x86_64/primary_db                                                   | 6.8 MB  00:00:00
(8/9): amzn2-core/2/x86_64/primary_db                                           |  39 MB  00:00:00
(9/9): treasuredata/2/x86_64/primary_db                                         |  15 kB  00:00:00
elastic-7.x                                                                                315/315
192 packages excluded due to repository priority protections
No packages marked for update

If you having rpmdb issues with your yum, you can easily follow the same steps and fix your package manager in a minute.

Share on Social Media
twitter facebook linkedin reddit

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • What is an Internet Gateway in AWS?
  • What are Route Tables on AWS VPC?
  • What is Subnet on AWS VPC?
  • What is AWS VPC?
  • Prevent nginx from caching DNS for proxy
  • Scaling PHP Applications on AWS
  • Create an S3 Bucket and Set a Policy via CLI
  • Issue a Let’s Encrypt SSL with the AWS Route53
  • Automate Let’s Encrypt SSL on AWS Application Load Balancer
  • Let’s Learn Kubernetes – Part 3
  • Deploy a website to S3 and CloudFront with Bitbucket Pipelines
  • Let’s Learn Kubernetes – Part 2
  • Protect your AWS Account with specified IPs
  • Let’s Learn Kubernetes – Part 1
  • Differences between AWS CLI v1 and v2
  • SSL CA Problem on CentOS7 Docker and Solution
  • What do I have?
  • Deploy HA nginx to AWS ECS with Geolocation Routing via Terraform
  • Deploy nginx docker to AWS ECS with Terraform Automation
  • How to Install Node Exporter on Linux Server
  • FortiClient Problem on M1 MacBookPro Problem Solution
  • Connect your AWS to GCP with Terraform via IPSec Site-to-Site VPN
  • Google Cloud Platform Automation with Terraform Easily
  • How to secure your Amazon Web Services account
  • Install UGREEN USB Ethernet Adapter on macOS
  • Redirect 301 HTTPS on App Engine with nginx on Google Cloud Platform
  • Set two different Target Groups on AWS Load Balancer with Terraform
  • Extend your ec2 Linux disk without reboot on Amazon Web Services
  • Create a New Grant User on AWS RDS (MariaDB)
  • Amazon S3 CORS Settings with CloudFront on Amazon Web Services
  • Take your GitLab backup everyday if it works in Docker
  • Find large files in CentOS, ubuntu and MacOS easily
  • Fix “Error: rpmdb open failed” on CentOS or Amazon Linux 2
  • Error: No space left on the device when starting/stopping services only
  • Juniper SRX110H-VA VDSL2 Configuration Step by Step
  • Enable Logrotation for Docker Containers
  • Download specific file extension via wget easily on terminal
  • Find the exact size of certain files in Linux via terminal
  • Disable SELinux on CentOS 7 or CentOS 8
  • Hello Blog!

Tag Cloud

active-active amazon linux 2 amazon web services automation aws basics bug centos centos7 cloud cloudfront container containers crud curl deployment devops docker ec2 ecs fargate file size gcp gitlab google cloud platform iam policy k8s kubernetes kubernetes architecture kubernetes basics linux macos network nginx pipeline replicaset route table s3 security terraform ubuntu vpc vpn wget yum

Archive

  • January 2023 (2)
  • December 2022 (2)
  • August 2022 (2)
  • July 2022 (3)
  • June 2022 (6)
  • March 2022 (1)
  • July 2021 (1)
  • May 2021 (5)
  • April 2021 (5)
  • February 2021 (1)
  • January 2021 (1)
  • September 2020 (2)
  • July 2020 (1)
  • April 2020 (1)
  • March 2020 (1)
  • February 2020 (1)
  • November 2019 (5)
©2023 Ercan Ermis | Built using WordPress and Responsive Blogily theme by Superb