Tag Archives: Yum

Clear yum Cache Error: rpmdb: Thread/process 24307/140520328255392 failed: Thread died in Befkeley DB library

Error prompt after executing the command:

[[email protected]]# yum clean all
rpmdb: Thread/process 24307/140520328255392 failed: Thread died in Befkeley DB library
error: db3 error (-30974) from dbenv-›failchk: DB_RUNRECOVERY: Fatal error, run database
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL: yum.main:

Error: rpmdb open failed

#Rpmdb: thread/process 24307/140520328255392 failed: thread died in befkeley DB Library
# error: db3 error (- 30974) from dbenv – › failchk: DB_ Runrecovery: fatal error, running database recovery
# error: unable to open package index using db3 – (- 30974)
# error: unable to open packages database in/var/lib/rpm
# key: yum.main:
# error: rpmdb open failed

In this case, the RPM database is damaged, which makes the yum and RPM related commands unusable. The above also prompts/var/lib/rpm, which is the path where the temporary files of the RPM database are located.


Rebuild RPM database

#Go to the path where rpmdb is located
cd /var/lib/rpm/
#List related files to find __db.*
#Delete or move the rpmdb file, I created a new directory and moved the file
mkdir old
mv _db.* old/
#Rebuild the rpm database after completion
rpm --rebuilddb

After the reconstruction is completed, execute Yum clean all again to solve the problem

[Solved] Yum Upgrade Error: yum makecache: error: argument timer: invalid choice: ‘fast’ (choose from ‘timer’)

1.Problem: When executing the command: yum makecache fast, an error is reported: yum makecache: error: argument timer: invalid choice: ‘fast’ (choose from ‘timer’) as follows

2. the cause and solution: CentOS 8 does not have fast this command, remove it!


Workaround for “could not retrieve mirrorlist” during Yum installation

[ [email protected] ~]# yum -y install wget    ( Note: after downloading the WGet command and installing it)

Could not retrieve mirrorlist   http://mirrorlist.centos.org/?release=5&amp ; arch=i386& repo=os   error was
[Errno 4] IOError: < urlopen error (-3, ‘\xe5\x9f\x9f\xe5\x90\x8d\xe8\xa7\xa3\xe6\x9e\x90\xe6\x9a\x82\xe6\x97\xb6\xe5\xa4\xb1\xe8\xb4\xa5’)>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

[ [email protected] ~]# yum install gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist   http://mirrorlist.centos.org/?release=5&amp ; arch=x86_ 64& repo=addons   error was
[Errno 4] IOError: < urlopen error (-3, ‘Temporary failure in name resolution’)>
Error: Cannot find a valid baseurl for repo: addons


Whether you use the command above or below, the error will appear

Reason: resolv.conf is not configured


Configure resolv.conf in the/etc directory to join the nameserver IP, such as:

search localdomain

Save and run the above command again.



/Configure DNS clients in/etc/resolv.conf  


/Etc/resolv.conf configure DNS client
file/etc/resolv.conf configure DNS client, which contains the domain name search order of the host and the address of the DNS server. Each line should contain a keyword and one or more parameters separated by spaces
here is an example file:

search localdomain

The legal parameters and their meanings are as follows:
nameserver indicates the IP address of the DNS server. There can be many rows of nameservers, each with an IP address. When querying, follow the order of nameservers in this file, and only when the first nameserver does not respond, query the following nameserver.
domain declares the domain name of the host. Many programs use it, such as mail system; It is also used when DNS query is performed for the master
machine without domain name. If there is no domain name, the host name will be used and all content before the first dot (.) will be deleted
search its multiple parameters indicate the order of domain name query. When you want to query a host without a domain name, the host will search separately in the domain declared by search. Domain and search cannot coexist; If both exist, the following will be used
sortlist allows you to sort the domain name results. Its parameters are network/mask pairs. Allow any sort order. The default/E T C/r e s o l v. c o n f file is not available in red hat. Its contents are dynamically created according to the options given at installation time.

How to Solve Yum Install Development Tools Error

An error occurred while installing development tools using yum

When we install the development tools development group tools through yum, we may sometimes encounter the following error messages

[[email protected] ~]# yum groupinstall "Development Tools"
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                    | 3.6 kB     00:00     
epel                                                    | 5.3 kB     00:00     
extras                                                  | 3.4 kB     00:00     
updates                                                 | 3.4 kB     00:00     
(1/7): base/7/x86_64/group_gz                             | 166 kB   00:00     
(2/7): epel/x86_64/updateinfo                             | 994 kB   00:01     
(3/7): extras/7/x86_64/primary_db                         | 205 kB   00:01     
(4/7): epel/x86_64/group_gz                               |  88 kB   00:05     
(5/7): epel/x86_64/primary_db                             | 6.8 MB   00:17     
(6/7): base/7/x86_64/primary_db                           | 6.0 MB   00:19     
(7/7): updates/7/x86_64/primary_db                        | 6.5 MB   00:19     
Warning: Group development does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

There are two solutions to this problem


Method 1

yum clean all
yum groupinstall "Development Tools"

Method 2

If the above method is useless, execute the following command

cd /etc/yum.repos.d
sudo wget http://public-yum.oracle.com/public-yum-el5.repo
cd /etc/pki/rpm-gpg/
sudo wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5

After execution, install

yum groupinstall "Development Tools"

The above methods are useful for personal testing. I hope they can help you

[Solved] Yum command error: could not retrieve mirrorlist http://mirrorlist.centos.org…

Yum command error reporting solution

Problem Description:

An error occurs when running the yum install gcc-c + + command on the VMware virtual machine

Error message:

could not retrieve mirrorlist http://mirrorlist.centos.org/release=6&arch=x86_64%repo=os error was 14: PYCURL ERROR 
6 - "Counldn't resolve host 'mirrorlist.centos.org'"

Possible cause analysis:

1. DNS is not set

2. The connection mode of the network adapter is incorrect. The NAT mode is used locally and the bridge mode is used for the router

3. IP is not in the same network segment

4. The virtual machine service is not turned on


1. Open the virtual machine — > Virtual machine settings — > Network adapter — > Network connection, set to bridge mode

2. Open ifcfg eno16777736 under etc/sysconfig/network scripts (the file name may be different), and set:



3. Open the resolv.conf file in the directory etc and set:

3.1 if the network cable is directly connected to the local route, make the following settings:

domain www.tendawifi.com            [loacal DNS]
search www.tendawifi.com            [loacal DNS]
nameserver                [loacal IP]

3.2 if WiFi is connected, set:

# this is google DNS

# localhost DNS
nameserver            [local default gateway]
nameserver [local IPv4 address]
search localdomain [fixed, means search local DNS]

4. Restart the service, service network restart, Ping Google Ping www.google.com

Error reporting using Yum: Yum except keyboardinterrupt, e

An error was reported when using Yum today:

[[email protected] /]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax

It turned out that I installed Python 3.5 a few days ago

According to the prompt, the solution:

[[email protected] /]# vim /usr/bin/yum #!/usr/bin/python import sys try: import yum except ImportError: print >> sys.stderr, """\

Change the above statement to the default version of python2.6 before the system:

#!/usr/bin/python2.6 import sys try: import yum except ImportError: print >> sys.stderr, """\

yum can be used


Python upgrade resulted in an error using yum

Today, we plan to install walle 2.0 according to the official documents http://www.walle-web.io/docs/index.html Step by step

At this step, an error is suddenly reported

yum install -y mariadb-devel gcc gcc-c++ python-devel


At first, I wondered if there was a problem with the yum source. Download and load the alicloud source again

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo 
yum clean all  
yum makecache

If you can’t find it, you still report an error

check the python version

# python
Python 2.7.5 (default, Oct 30 2018, 23:45:53) 

It is found that Python has been upgraded to 2.7.5, and the python version required by Yum is 2.6, resulting in an error

modify the yum startup file prefix

# cat /usr/bin/yum

It is found that it is useless and there is no backup. Python is directly updated to 2.7.5. The library used by Yum cannot be loaded and the module cannot be loaded

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.


Find the information, try to install another version of python2.6.6, and modify the yum startup file, but the module cannot be loaded

reinstall Python and Yum

1. Uninstall existing Python and force the removal of installed programs and their associations

rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps

Force deletion of all residual files

whereis python |xargs rm -frv

2. Uninstall existing yum

rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps

Force deletion of all residual files

whereis yum |xargs rm -frv

3. Download the RPM package corresponding to the version

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-build-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-sign-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-python-4.11.3-35.el7.x86_64.rpm

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-2.7.5-76.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-devel-2.7.5-76.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-libs-2.7.5-76.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-backports-ssl_match_hostname-
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-chardet-2.2.1-1.el7_1.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-virtualenv-15.1.0-2.el7.noarch.rpm

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-50.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-plugin-aliases-1.1.31-50.el7.noarch.rpm

Install these packages after downloading (- – force forced installation)

rpm -Uvh --force --nodeps --replacepkgs *.rpm

After installing these RPM packages, yum can be used normally. If you still report the following, it means that you haven’t downloaded all the RPM packages

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /usr/lib64/python2.7/site-packages/rpm/_rpm.so: undefined symbol: rpmpkgVerifySi

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

If you cannot solve this problem yourself, please go to
the yum faq at:


Then press the walle official document to install step by step, and the installation is completed successfully ~:)

say important things three times

Python upgrade is upgraded with the downloaded package. Back up the old version before upgrading

Python upgrade is upgraded with the downloaded package. Back up the old version before upgrading

Python upgrade is upgraded with the downloaded package. Back up the old version before upgrading


Install the software Yum to process the error segmentation fault [Solved]

yum installation software error Segmentation fault handling


When using yum to update software, it prompts.
Segmentation fault

Chinese error message: Segmentation fault

[[email protected]:/usr/local/lib]# yum install -y screen
Freeing read locks for locker 0x2f: 13195/140686785021696
Freeing read locks for locker 0x31: 13195/140686785021696
Freeing read locks for locker 0x32: 13195/140686785021696
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://apt.sw.be/redhat/el6/en/mirrors-rpmforge error was
14: PYCURL ERROR 6 – “Couldn’t resolve host ‘apt.sw.be'”
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Segmentation fault

It is possible that zlib was manually compiled and installed, and /etc/ld.so.conf was modified to include /usr/local/lab

The system has two versions of zlib, use ldconfig -v|grep libz to see the two versions of zlib.


[[email protected]:/usr/local/lib]# ldconfig -v|grep libz
ldconfig: Can’t stat /usr/local/lab/libevent-2.0.21-stable/lib: No such file or directory
libz.so.1 -> libz.so.1.2.5
libz.so.1 -> libz.so.1.2.3
[[email protected]:/usr/local/lib]# find/-name ‘libz.so.1’

So, comment out the zlib in /etc/ld.so.conf.
[[email protected]:/data/mysql_data]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
#####ADD BY lx#####

Execute ldconfig once

Execute yum clean all

yum install screen -y


Yum installer reported an error: nothing to do [How to Solve]

Today, install some common software on a new server. At the beginning, install NCDU (a very useful disk analysis tool to find large files). The errors are as follows:

I found various methods on the Internet. It’s useless to update Yum and clean up Yum cache

The last problem found is the lack of EPEL (EPEL is a free and open source software package version library strongly built by the community, and the system contains about 10000 software packages). I am centos7, so I need to install this first

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Other versions can be installed on the official website https://fedoraproject.org/wiki/EPEL

After that, NCDU will be installed normally

yum -y install ncdu