Summary: CentOS yum error analysis solution

Source: Internet
Author: User
Tags gpg centos nameserver

I. Today, when I was on a small cloud host in yum, I encountered an error:

$ Yum-y update
Rpmdb: Thread/process 28636/139844750771968 failed: Thread died in Berkeley DB library
Error: db3 error (-30974) from dbenv-> failchk: DB_RUNRECOVERY: Fatal error, run database recovery
Error: cannot open Packages index using db3-(-30974)
Error: cannot open Packages database in/var/lib/rpm
CRITICAL: yum. main:
Error: rpmdb open failed

Generally, rpmdb fails to be opened. So google

Solution:

# Clear cache
Rm/var/lib/rpm/_ db *
# Rebuilding
Rpm -- rebuilddb
After that, you can perform normal update.


2. When installing software on centOs. Error message:


Cocould not retrieve into listhttp: // your list.centos.org /? Release = 6 & arch = x86_64 & repo = OS error was

14: pycurl error 6-"Couldn't resolvehost 'using list .centos.org '"

Cocould not retrieve into listhttp: // your list.centos.org /? Release = 6 & arch = x86_64 & repo = extras errorwas

14: pycurl error 6-"Couldn't resolvehost 'using list .centos.org '"

Cocould not retrieve into listhttp: // your list.centos.org /? Release = 6 & arch = x86_64 & repo = updates errorwas

14: pycurl error 6-"Couldn't resolvehost 'using list .centos.org '"

Listen 14] pycurl error 6-"Couldn't resolve host 'mirrors .163.com '"

Trying other mirror.

Error: Cannot retrieve repository metadata (repomd. xml) for repository: base. Please verify its path and try again

[Root @ hbase01-222 ~] # Service iptables stop

[Root @ hbase01-222 ~] # Nslookup list.centos.org

; Connection timed out; no servers couldbe reached

I found the problem here. My domain name cannot be resolved, and the domain name pointed to in the yum configuration file cannot be identified. Reset dns pointing.

[Root @ hbase01-222 ~] # Vim/etc/resolv. conf

# Generated by NetworkManager

 

Nameserver 8.8.8.8

[Root @ hbase01-222 ~] # Yum install gcc-c ++

Solve Centos yum update error

The error message is as follows:

Loaded plugins: fastestmirror, langpacks

1. dns problems

2. Image connection error

 

DNS problems

First, let's talk about the dns problem. The test method is to ping the internet and find that the ping fails.

Solution:

Echo "nameserver 8.8.8.8">/etc/resolv. conf

 

Image connection error

If this is the second problem, consider using a domestic image, such as a 163 image.

Solution:

Take centos 7 as an example. You can change the number of other versions to a large version.

Cd/etc/yum. repos. d

Mv CentOS-Base.repo CentOS-Base.repo.bak

Vi CentOS-Base.repo

[Base]
Name = Red Hat Enterprise Linux 7.0-Base
Baseurl = http://mirrors.163.com/centos/7/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[Update]
Name = Red Hat Enterprise Linux 7.0-Updates
Baseurl = http://mirrors.163.com/centos/7/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[Extras]
Name = Red Hat Enterprise Linux 7.0-Extras
Baseurl = http://mirrors.163.com/centos/7/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
Save it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.