Chinaunix首页 | 论坛 | 博客
  • 博客访问: 243835
  • 博文数量: 29
  • 博客积分: 634
  • 博客等级: 上士
  • 技术积分: 432
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-09 22:24
文章分类

全部博文(29)

文章存档

2012年(8)

2011年(21)

分类: LINUX

2011-03-18 17:42:16

由于,redhat企业版yum为收费项目,所以更换免费的源,这样在架设服务器的时候缺少某些组件可以用yum来进行添加,方便快捷,其实yum的速度没有太慢的,下面我将为大家介绍如何快速的修改yum源。
    一、删除原yum所有组件
  1. rpm -qa | grep yum | xargs rpm -e --nodeps #这条代码将删除redhat自带的yum

   二、下载yum组件 yum.rar    

rpm包已经有了,自己下载解压(有人会问为什么不用源代码安装,那么你吃个鹌鹑蛋还要刀叉吗)

 

  1. [root@localhost yum]# ll
  2. total 1108
  3. -rw-r--r-- 1 root root 34394 Feb 25 09:46 python-iniparse-0.2.3-4.el5.noarch.rpm
  4. -rw-r--r-- 1 root root 1026405 Feb 25 09:45 yum-3.2.22-26.el5.centos.noarch.rpm
  5. -rw-r--r-- 1 root root 19145 Feb 25 09:46 yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
  6. -rw-r--r-- 1 root root 26053 Feb 25 09:41 yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm

    三、下面将要安装着四个软件包,切记按照我的安装顺序来,否则会出现报错,切记~

 

     cd /tools/yum
  1. rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm
  2. rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
  3. rpm -ivh yum-3.2.22-26.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm

    四、下面下载yum的配置文件,点击下载 CentOS-Base.rar  

    上面的包是为redhat5.4准备的,如果你用不了的话,就把下面的代码写到CentOS-Base.repo中 保存在

/etc/yum.repos.d/

 

# CentOS-Base.repo

# # This file uses a new mirrorlist system developed by Lance Davis for CentOS.

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client. You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

# [base]

name=CentOS-$releasever - Base

baseurl=

gpgcheck=1

gpgkey=

#released updates

[updates]

name=CentOS-$releasever - Updates

baseurl=

gpgcheck=1

gpgkey=

#packages used/produced in the build but not released

[addons]

name=CentOS-$releasever - Addons

baseurl=

gpgcheck=1

gpgkey=

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

baseurl=

gpgcheck=1

gpgkey=

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

baseurl=

gpgcheck=1 enabled=0

gpgkey=

 

    把这个文件放在    /etc/yum.repos.d/

    大功告成,yum已经更新为不用花钱的啦  

注:如何觉着下载这么多不方便,可以下下载 yum.rar  这个包,放在/tools/下面  然后执行“sh /tools/yum/yum_stat.sh"  即可

阅读(18218) | 评论(0) | 转发(2) |
0

上一篇:mysql双机热备详解及延伸备份

下一篇:stats

给主人留下些什么吧!~~