Re-install Yum under CentOS

Source: Internet
Author: User

1, download the latest yum-3.2.28.tar.gz and unzip

#wget http://yum.baseurl.org/download/3.2/yum-3.2.28.tar.gz
#tar XVF yum-3.2.28.tar.gz

2, go to the directory, run the installation

#cd yum-3.2.28
#./yummain.py Install Yum
If you are prompted with an error: CRITICAL:yum.cli:Config error:error accessing file for Config file:///etc/

The configuration file is missing. Create a new yum.conf file under the ETC directory and run yummain.py install Yum again to successfully complete the installation.

3, last update system

#yum check-update
#yum Update
#yum Clean All

The reported error

--------------------------------------------------------------------------------------------------------------- -------

yummain.py install Yum does not work because of yummain.py not found,

[[Email protected] ~] wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-8.el6.noarch.rpm

[[Email protected] ~] wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/python-pycurl-7.19.0-8.el6.x86_64.rpm

[[Email protected] ~] wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/ yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

[[Email protected] ~] RPM-IVH python-urlgrabber-3.9.1-8.el6.noarch.rpm python-pycurl-7.19.0-8.el6.x86_64.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

If you do not install the Python-urlgrabber,python-pycurl,yum-metadata-parser 3 packages, run below./yummain.py Install Yum will report the following error:

The error is as follows

if the above RPM connection fails, please go here to find one: http://rpm.pbone.net/

Error 1: [[email protected] yum-3.4.3]#./yummain.py Traceback (most recent call last): File "./yummain.py", line-in < Module> from yum import Errors File "/root/nagios/yum-3.4.3/yum/__init__.py", line-in <module> import config File "/root/nagios/yum-3.4.3/yum/config.py", line A, in <module> from parser import Configpreprocessor, Varreplace File "/root/nagios/yum-3.4.3/yum/parser.py", line 4, in <module> import Urlgrabber importerror:no modul E named Urlgrabber

Error 2: [[email protected] yum-3.4.3]#./yummain.py Traceback (most recent call last): File "./yummain.py", line-in < Module> from yum import Errors File '/root/nagios/yum-3.4.3/yum/__init__.py ', line-in <module> import Rpmsack File "/root/nagios/yum-3.4.3/yum/rpmsack.py", line +, in <module> import yum.depsolve file "/root/nagios/yum-3.4 .3/yum/depsolve.py ", line A, in <module> from transactioninfo import transactionmember File"/root/nagios/yum-3.4 .3/yum/transactioninfo.py ", line +, in <module> from sqlitesack import yumavailablepackagesqlite File"/root/ nagios/yum-3.4.3/yum/sqlitesack.py ", line +, in <module> import Yumrepo File"/root/nagios/yum-3.4.3/yum/ yumrepo.py ", line <module> import sqlitecachec importerror:no module named SQLITECACHEC

Create a Yum configuration file

[[Email protected] ~] touch/etc/yum.conf

Note: If you do not create yum.conf, run below./yummain.py Install Yum will report the following error:

[Email protected] yum-3.4.3]#./yummain.py CRITICAL:yum.cli:Config error:error accessing file for Config file:///etc/yu M.conf

Download Yum source package and install

[[Email protected] ~] wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz

Unzip the source package [[email protected] ~] Tar zxvf yum-3.4.3.tar.gz

Compile and install Yum[[email protected] ~] CD yum-3.4.3

[[email protected] yum-3.4.3]./yummain.py Install Yum

Base | 3.7 KB 00:00

base/primary_db | 4.5 MB 00:07

Extras | 3.5 KB 00:00

extras/primary_db | KB 00:03

The above hints show that Yum has been installed successfully.

Re-install Yum under CentOS

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.