你好,游客 登录 注册 搜索
背景:
阅读新闻

CentOS 5.4添加/删除软件 报错

[日期:2013-03-08] 来源:Linux社区  作者:ljg888 [字体:大 中 小]

现在进入到/etc/yum.repos.d目录
该目录有两个文件。一个是CentOS-Base.repo另外一个是CentOS-Media.repo
第一个文件CentOS-Base.repo负责在网络环境中的安装源管理,如果你的yum源是在网络上需要使用ftp HTTP等服务才能正确安装软件,请使用它。而你的yum源是在本机上就使用CentOS-Media.repo,将CentOS-Media.repo改名为CentOS-Media.repo.bak
在这里,既然已经制作的光盘镜像文件,那么就采用CentOS-Media.repo文件,而把CentOS-Base.repo改个名字。只要不是以.repo作为后缀就可以。比方说改名为CentOS-Base.repo.bak或者将CentOS-Base.repo移动到其他目录。

现在打开CentOS-Base.repo文件,在里面编辑
修改成如下内容:
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///yum/iso
# file:///media/cdrom/
# file:///media/cdrecorder/
gpgcheck=0
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

注意一下。在这个文件前面的注释里面有这样的内容:
# or for ONLY the media repo, do this:
#
# # or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c5-media [command]
[command]

就是说如果你只想使用本机上的yum源需要运行yum --disablerepo=[red]/[/red]* --enablerepo=c5-media

注意,文档中的斜线方向错了。需要改正。

[root@fom yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@fom yum.repos.d]# yum list
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
Deployment_Guide-zh-CN.noarch 5.2-11.el5.centos installed
Deployment_Guide-zh-TW.noarch 5.2-11.el5.centos installed
GConf2.i386 2.14.0-9.el5 installed
ImageMagick.i386 6.2.8.0-4.el5_1.1 installed
MAKEDEV.i386 3.23-1.2 installed
MySQL-python.i386 1.2.1-1 installed
NetworkManager.i386 1:0.7.0-9.el5 installed
NetworkManager-glib.i386 1:0.7.0-9.el5 installed
NetworkManager-gnome.i386 1:0.7.0-9.el5 installed
…………………………
[root@fom yum.repos.d]# system-config-packages
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Loading mirror speeds from cached hostfile

Loading mirror speeds from cached hostfile

CentOS 5.4添加/删除软件 报错

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

linux
相关资讯       CentOS 5.4 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款