New Blog addr: ozziechen.blogspot.com
After installed the RHEL4, I can't use Yum command to install common tools. Found two steps to install Yum and summary for this:
Step 1: Install Yum
Reference to http://peiyan.blog.51cto.com/344889/177666Download Yum
[root@st ~]# wget http://www.parallels.com.cn/downloads/Prima/Tools/yum_forAS4.tar.gz
[root@st ~]# tar zxvf yum_forAS4.tar.gz
yum_forAS4/
yum_forAS4/CentOS-Base.repo
yum_forAS4/python-elementtree-1.2.6-7.el4.rf.i386.rpm
yum_forAS4/python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm
yum_forAS4/yum-2.4.2-0.4.el4.rf.noarch.rpm
yum_forAS4/sqlite-2.8.16-1.2.el4.rf.i386.rpm
yum_forAS4/python-sqlite-1.0.1-1.2.el4.rf.i386.rpm
[root@st ~]# cd yum_forAS4
[root@st yum_forAS4]# ls CentOS-Base.repo
python-elementtree-1.2.6-7.el4.rf.i386.rpm
python-sqlite-1.0.1-1.2.el4.rf.i386.rpm
python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpmf
sqlite-2.8.16-1.2.el4.rf.i386.rpm
yum-2.4.2-0.4.el4.rf.noarch.rpm
[root@st yum_forAS4]# rpm -ivh *.rpm
warning: python-elementtree-1.2.6-7.el4.rf.i386.rpm: V3 DSA signature: NOKEY,
key ID 6b8d79e6
Preparing... ########################################### [100%]
1:sqlite ########################################### [ 20%]
2:python-sqlite ########################################### [ 40%]
3:python-urlgrabber ########################################### [ 60%]
4:python-elementtree ########################################### [ 80%]
5:yum ########################################### [100%]
[root@st yum_forAS4]# cp CentOS-Base.repo /etc/yum.repos.d/
Import GPG Key
[root@st yum_forAS4]# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-4
Step 2: Solve Errno256: no more mirrors to try
After installed Yum, I found I can't use it to update or install tools and cause "Errno 256: no more mirrors to try" with the error file"repomd.xml".
Solution:
Find the file at /etc/yum.repos.d/CentOS-Base.repo, open it and find your mirror address(may ftp/ http etc. ). If your mirror address is: http://mirror.centos.org/centos/4/os/ or sort like this, paste it in your url, you'll find an old address.
Finally, you'll link to http://vault.centos.org/4.X/, and open the file named CentOS-Base.repo. Replace it to your own local file, it'll work.