CENTOS6 Yum installation related problems and handling
To use Yum to download files, suddenly yum can not download the desired files, want to change the Yum source, the result is to reinstall Yum
From my github address https://github.com/mrsmallyi/LinuxNote/blob/master/yum.md
First, question 1
[[email protected] ~]# yum -vThere was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was: No module named yumPlease install a package which provides this module, orverify that the module is installed correctly.It‘s possible that the above module doesn‘t match thecurrent version of Python, which is:2.6.6 (r266:84292, Nov 22 2013, 12:16:22) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq
Workaround and steps:
- Remove the Yum and related packages from the original Rhel.
rpm -qa | grep yum | xargs rpm -e --nodepsrpm -qa |grep python-urlgrabber|xargs rpm -e --nodeps
- Download the relevant package for CENTOS6. python-urlgrabber-3.9.1-11.el6.noarch.rpm python-iniparse-0.3.1-2.1.el6.noarch.rpm yum-3.2.29-81.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpmwget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpmwget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpmwget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpmwget http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
Note: If the file cannot be downloaded, it may be a version issue, re-download the relevant file to the Http://mirrors.ustc.edu.cn/centos/6/os/x86_64/Packages/directory
- Install the downloaded installation package
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpmrpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm rpm -ivh yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
- Check if the installation is successful
rpm -qa | grep yum rpm -qa | grep python
Ii. Question 2-http://apt.sw.be/redhat/el6/en/x86_64/dag/repodata/repomd.xml: [Errno] Pycurl ERROR 6-"couldn ' t resolve hos T ' apt.sw.be ' problem handling
[[email protected] yum.repos.d]# yum makecache已加载插件:fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.combase | 3.7 kB 00:00 http://apt.sw.be/redhat/el6/en/x86_64/dag/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn‘t resolve host ‘apt.sw.be‘"尝试其他镜像。错误:Cannot retrieve repository metadata (repomd.xml) for repository: dag. Please verify its path and try again
This problem finally understand Yum Source address is not, have to change;
Workaround:
CD/ETC/YUM.REPOS.D into this directory, there is a file Dag.repo file (may not be the same name) inside the baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
VI compile the address inside BaseURL, the back of the address replacement I simply found there is an article 42614105 has a lot of addresses, and then replaced, not afraid of the address are not used.
[Dag]name=dag RPM Repository for Red Hat Enterprise linuxbaseurl=http://archive.cs.uu.nl/mirror/dag.wieers/redhat/el$ releasever/en/$basearch/dag http://apt.sw.be/redhat/el$releasever/en/$basearch/dag http://dag.linux.iastate. edu/dag/redhat/el$releasever/en/$basearch/dag http://ftp.riken.jp/linux/dag/redhat/el$releasever/en/$basearch/ dag/http://ftp2.lcpe.uni-sofia.bg/freshrpms/pub/dag/redhat/el$releasever/en/$basearch/dag http://ftp.heanet . ie/pub/freshrpms/pub/dag/redhat/el$releasever/en/$basearch/dag http://ftp-stud.fht-esslingen.de/dag/redhat/el$ releasever/en/$basearch/dag http://mirror.cpsc.ucalgary.ca/mirror/dag/redhat/el$releasever/en/$basearch/dag http://mirrors.ircam.fr/pub/dag/redhat/el$releasever/en/$basearch/dag http://rh-mirror.linux.iastate.edu/pub/ dag/redhat/el$releasever/en/$basearch/dag http://rpmfind.net/linux/dag/redhat/el$releasever/en/$basearch/dag Http://wftp.tu-chemnitz.de/pub/linux/dag/redhat/el$releasever/en/$basearch/dag http://www.mirrorservice.org/sites/apt.sw.be/redhat/el$releasever/en/$ Basearch/daggpgcheck=1enabled=1gpgkey=http://dag.wieers.com/rpm/packages/rpm-gpg-key.dag.txt
- Use the following command to update to the latest system
yum -y update # -y 代表自动回答yes来开始下载与安装
Linux--CENTOS6 Yum installation related issues and handling