Chinaunix首页 | 论坛 | 博客

  • 博客访问: 7674
  • 博文数量: 5
  • 博客积分: 272
  • 博客等级: 二等列兵
  • 技术积分: 62
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-18 16:52
文章分类
文章存档

2013年(1)

2010年(4)

我的朋友

分类: LINUX

2010-11-22 13:14:57

背景:我vmvare虚拟机里原来安装的是rhel5.4,但是我由于实际需要我得把软件包升级,这样我务必要把yum源更换,而不能再依赖于rhel的本地yum源!http://blog.chinaunix.net/u3/117015/showart.php?id=2275707(yun本地源)

更换软件源:
#cd /etc/yum.repos.d
[root@localhost yum.repos.d]#mv CentOS-Base.repo CentOS-Base.repo.save
[root@localhost yum.repos.d]#wget
[root@localhost yum.repos.d]#mv CentOS-Base.repo.5 CentOS-Base.repo
最好的源:
# 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=

此时如果你就进行保存,退出!然后yum update!我保证会出问题!
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. 
Please verify its path and try again
怎么办呢?其实是因为rhel在作怪,
我们来看个东西
[base]
name=CentOS-$releasever - Base
baseurl=$releasever/os/$basearch/
gpgcheck=1
gpgkey=

看到$releasever参数没有?在centos中能自动识别版本,但是rhel中不行。这是我得出的初步结论,没得到确切答案!暂且这样理解!


那如何解决呢?问题出现了,一定得解决啊!这才是主要的!
在vim的末行模式下,键入:g/$releasever/s//5/g,用5替换掉所有$releasever参数。
rpm --import  
yum clean all
yum update

一切完成,ok!

阅读(318) | 评论(0) | 转发(0) |
0

上一篇:lamp

下一篇:AIX系统磁盘规划脚本

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