RedHat改用CentOS的yum组件,步骤有点麻烦,为了方便大家,写了个脚本的自动配置。。。。
yum源用的是epel和科技大学的。
- #/bin/bash
- #by rfyiamcool
- #echo "nameserver 8.8.8.8" >>/etc/resolv.conf
- mkdir /root/yum
- cd /root/yum
- rpm -qa|grep yum|xargs rpm -e --nodeps
- if ! rpm -qa|grep yum ;then
- echo uninstall yum ok
- else
- rpm -qa |grep yum
- exit
- fi
- wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
- wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
- wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
- echo dowoload cetnos-yum ok
- rpm -ivh yum-*.rpm
- echo install cetnos-yum ok
- cd /etc/yum.repos.d
- wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
- rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
- cat >> epel.repo <<EOF
- [epel]
- name=Extra Packages for Enterprise Linux 5 - \$basearch
- #baseurl=http://download.Fedoraproject.org/pub/epel/5/\$basearch
- mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=\$basearch
- failovermethod=priority
- enabled=1
- gpgcheck=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
-
- [epel-debuginfo]
- name=Extra Packages for Enterprise Linux 5 - \$basearch - Debug
- baseurl=http://download.fedoraproject.org/pub/epel/5/\$basearch/debug
- #mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=\$basearch
- failovermethod=priority
- enabled=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
- gpgcheck=1
-
- [epel-source]
- name=Extra Packages for Enterprise Linux 5 - \$basearch - Source
- #baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
- mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=\$basearch
- failovermethod=priority
- enabled=1
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
- gpgcheck=1
- EOF
- yum makecache
- yum list httpd*