使用CentOS源为RHEL6.0-64bit添加glibc.i686库[附打包下载]


使用CentOS源为RHEL6.0-64bit添加glibc.i686库[附打包下载]

蛋疼的一天,当初接到通知说要将原来的EA 32-bit with RHEL5.x 32-bit升级为EA 64bit with RHEL6.x 64-bit的时候,我就觉得麻烦大了,倒不是说这个升级有多麻烦,而是一直没有一个比较统一的OS image,很多site都试了,可都出现了问题,我这也不例外。

昨天晚上启动的OS installation(因为是网络安装,巨慢无比,不得不提前一晚准备,期间还出了个Fatal Error,不过被我忽略了,不过后来进入X windows后又提示了,看图,不过又被我忽略了,初看起来应该还是yum源的问题),昨天一大早到了公司,抱着试一试的心态打算重新做一次,于是杯具的事情发生了!各种蛋疼扑面而来!

其他的懒得说了,挑一个比较有价值的说一下:使用163 CentOS的源为RHEL6.0 64-bit系统添加glibc.i686库。

因为是网络安装,所以没有本地源,只能配置yum的repo来解决,问题是在公司里找了半天都没找到可用的yum源,郁闷啊,不过最后问题勉强也算是解决了。

方便起见,干脆把步骤整理下贴在这里了,顺便上传了那几个rpm包以及那个repo配置文件,不想wget的朋友直接下载好了!

原始问题

  1. /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory  

报错信息

在我执行yum install glibc.i686的时候,因为没有可用的源(本地源和网络源都没有),因此报错:

  1. #yum install glibc.i686   
  2. [root@hzlinea04 ~]-> yum install glibc.i686   
  3. Loaded plugins: refresh-packagekit, rhnplugin   
  4. Config Error: File contains no section headers.   
  5. file: file://///etc/yum.repos.d/rhel.repo, line: 1   
  6. '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n'  

解决方法

1. Switch to root account

2. Delete the self-contained yum by running following command:

  1. rpm -aq|grep yum | xargs rpm -e --nodeps  

3. wget the rpm packages of CentOS 6:

4. Install them(If you met any dependency problem, just try again):

  1. rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm   
  2. rpm -ivh yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm   
  3. rpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm  

5. Add following contents to a new file named as "CentOS-Base.repo":

  1. [base]     
  2. name=CentOS-6 - Base     
  3. repo=os     
  4. baseurl=http://mirrors.163.com/centos/6/os/$basearch/     
  5. gpgcheck=1     
  6. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6     
  7.      
  8. #released updates     
  9. [update]     
  10. name=CentOS-6 - Updates     
  11. baseurl=http://mirrors.163.com/centos/6/updates/$basearch/     
  12. gpgcheck=1     
  13. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6     
  14.      
  15. #packages used/produced in the build but not released     
  16. #[addons]     
  17. #name=CentOS-6 - Addons     
  18. #baseurl=http://mirrors.163.com/centos/5/addons/$basearch/     
  19. #gpgcheck=1     
  20. #gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5     
  21.      
  22. #additional packages that may be useful     
  23. [extras]     
  24. name=CentOS-6 - Extras     
  25. baseurl=http://mirrors.163.com/centos/6/extras/$basearch/     
  26. gpgcheck=1     
  27. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6     
  28.      
  29.      
  30. #additional packages that extend functionality of existing packages     
  31. [centosplus]     
  32. name=CentOS-6 - Plus     
  33. baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/     
  34. gpgcheck=1     
  35. enabled=1     
  36. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6     
  37.      
  38. #contrib - packages by Centos Users     
  39. [contrib]     
  40. name=CentOS-6 - Contrib     
  41. baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/     
  42. gpgcheck=1     
  43. enabled=0     
  44. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6  

6. Copy or move the file CentOS-Base.repo to /etc/yum.repos.d(You may need to rename other .repo files):

  1. mv ./CentOS-Base.repo /etc/yum.repos.d/  

7. Clean the yum cache:

  1. yum clean all  

8. Done, have try to use yum.

猜你喜欢

转载自cppmule.iteye.com/blog/1705594