使用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的朋友直接下载好了!
原始问题
- /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
报错信息
在我执行yum install glibc.i686的时候,因为没有可用的源(本地源和网络源都没有),因此报错:
- #yum install glibc.i686
- [root@hzlinea04 ~]-> yum install glibc.i686
- Loaded plugins: refresh-packagekit, rhnplugin
- Config Error: File contains no section headers.
- file: file://///etc/yum.repos.d/rhel.repo, line: 1
- '<!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:
- rpm -aq|grep yum | xargs rpm -e --nodeps
3. wget the rpm packages of CentOS 6:
- wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
- wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
- wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
- wget http://mirrors.163.com/centos/6.0/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
4. Install them(If you met any dependency problem, just try again):
- rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
- rpm -ivh yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
- 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":
- [base]
- name=CentOS-6 - Base
- repo=os
- baseurl=http://mirrors.163.com/centos/6/os/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
- #released updates
- [update]
- name=CentOS-6 - Updates
- baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
- #packages used/produced in the build but not released
- #[addons]
- #name=CentOS-6 - Addons
- #baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
- #gpgcheck=1
- #gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- #additional packages that may be useful
- [extras]
- name=CentOS-6 - Extras
- baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
- gpgcheck=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-6 - Plus
- baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
- gpgcheck=1
- enabled=1
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
- #contrib - packages by Centos Users
- [contrib]
- name=CentOS-6 - Contrib
- baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
- gpgcheck=1
- enabled=0
- 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):
- mv ./CentOS-Base.repo /etc/yum.repos.d/
7. Clean the yum cache:
- yum clean all
8. Done, have try to use yum.