redhat yum resource

在进行以下操作前请确保已经完全卸载红帽子自带更新源,有两种方法:

方法1(命令),打开终端,输入“yum remove yum-rhn-plugin”命令,按照向导即可;

方法2(图形),root用户登录系统,依次选择“System-Administration-Add/Remove Software”,在搜索框中输入“subscription”搜索卸载即可。

  下面我将介绍如何完成Red Hat Enterprise Linux 6.1更新源的配置的,依照参考方法:

  1. 首先,使用如下命令导入导入atrpms.net 的软件包签名

[html]  view plain copy
  1. rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms  

  对于较老的版本,如果上面的命令失败,请使用如下两个命令再次尝试:

[html]  view plain copy
  1. wget http://packages.atrpms.net/RPM-GPG-KEY.atrpms  
  2. rpm --import RPM-GPG-KEY.atrpms  

  如果依旧错误,哥哥也帮不了你了,你还是到google寻找其他配置方法,或者到网站再search一下。

  2.  编辑/etc/smart/channels/smart.channel文件(如果系统中没有该文件,请自行创建目录【操作命令:mkdir -p /etc/smart/channels】和文件【操作命令:vi /etc/smart/channels/smart.channel】),按照上面的格式进行修改,本人修改后的smart.channel文件如下所示:

[html]  view plain copy
  1. #  
  2. # atrpms  
  3. # el6Server - i386 - ATrpms  
  4. #  
  5. [atrpms]  
  6. name=el6Server - i386 - ATrpms  
  7. baseurl=http://dl.atrpms.net/el6Server-i386/atrpms/stable/  
  8. type=rpm-md                 

  3. 编辑  /etc/apt/so urces.list文件,本人系统/etc/apt/下没有sources.list文件,我是自己创建的这个文件,读者的系统中如无本文件,请自行创建,并将以下内容写到该文件中:

[html]  view plain copy
  1. #  
  2. #  atrpms  
  3. #  el6Server - i386 - ATrpms  
  4. #  
  5. repomd http://dl.atrpms.net/el6Server-i386/atrpms/stable/  

  4. 把以下内容添加到/etc/yum.conf文件里面:

[html]  view plain copy
  1. [atrpms]  
  2. name=el6Server - $releasever - $basearch - ATrpms  
  3. baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable  
  4. gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms  
  5. gpgcheck=1  
  笔者修改后的/etc/yum.conf文件内容如下所示:

[html]  view plain copy
  1. [main]  
  2. cachedir=/var/cache/yum/$basearch/$releasever  
  3. keepcache=0  
  4. debuglevel=2  
  5. logfile=/var/log/yum.log  
  6. exactarch=1  
  7. obsoletes=1  
  8. gpgcheck=1  
  9. plugins=1  
  10. installonly_limit=3  
  11.   
  12. #  This is the default, if you make this bigger yum won't see if the metadata  
  13. # is newer on the remote and so you'll "gain" the bandwidth of not having to  
  14. # download the new metadata and "pay" for it by yum not having correct  
  15. # information.  
  16. #  It is esp. important, to have correct metadata, for distributions like  
  17. # Fedora which don't keep old packages around. If you don't like this checking  
  18. # interupting your command line usage, it's much better to have something  
  19. # manually check the metadata once an hour (yum-updatesd will do this).  
  20. metadata_expire=90m  
  21.   
  22. # PUT YOUR REPOS HERE OR IN separate files named file.repo  
  23. # in /etc/yum.repos.d  
  24.   
  25. [atrpms]  
  26. name=el6Server - $releasever - $basearch - ATrpms  
  27. baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable  
  28. gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms  
  29. gpgcheck=1  

  完成以上内容,便可以更新系统相关软件了,不信你可以自己试试,反正我成功了!


  同样的,可以按照以上方式配置rhel 5.1/5.6的更新源,只需要修改部分内容即可,本文在此不再赘述,仅仅贴出操作命令:

[plain]  view plain copy
  1. [root@localhost ~]# rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms  
  2. [root@localhost ~]# mkdir -p /etc/smart/channels/  
  3. [root@localhost ~]# vi /etc/smart/channels/smart.channel  
  4.   
  5. #  
  6. # atrpms  
  7. # el5Server - i386 - ATrpms  
  8. #  
  9. [atrpms]  
  10. name=el5Server - i386 - ATrpms  
  11. baseurl=http://dl.atrpms.net/el6Server-i386/atrpms/stable/  
  12. type=rpm-md  
  13. ~  
  14. ~  
  15. [root@localhost ~]# mkdir -p /etc/apt  
  16. [root@localhost ~]# vi  /etc/apt/sources.list  
  17.   
  18. #  
  19. #  atrpms  
  20. #  el5Server - i386 - ATrpms  
  21. #  
  22. repomd http://dl.atrpms.net/el5Server-i386/atrpms/stable/  
  23.   
  24. [root@localhost ~]# vi /etc/yum.conf  
  25.   
  26. [main]  
  27. cachedir=/var/cache/yum  
  28. keepcache=0  
  29. debuglevel=2  
  30. logfile=/var/log/yum.log  
  31. pkgpolicy=newest  
  32. distroverpkg=redhat-release  
  33. tolerant=1  
  34. exactarch=1  
  35. obsoletes=1  
  36. gpgcheck=1  
  37. plugins=1  
  38. metadata_expire=1800  
  39.   
  40. # PUT YOUR REPOS HERE OR IN separate files named file.repo  
  41. # in /etc/yum.repos.d  
  42.   
  43.   
  44. [atrpms]  
  45. name=el5Server - $releasever - $basearch - ATrpms  
  46. baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable  
  47. gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms    
  48. gpgcheck=1   

  在更新的过程中可能会有一些错误,下面这个问题是本人刚刚(2011年10月24日 15:30)遇到的。

[plain]  view plain copy
  1. [root@localhost ~]# Error: yum conflicts with yum-rhn-plugin < 0.5.2-3.el5  

  由于计算机比较差,不能打开图形界面,只能通过终端进行操作,首先查找yum-rhn-plugin软件包:

[plain]  view plain copy
  1. [root@localhost ~]# rpm -qa | grep 'yum-rhn-plugin-*'  
  2. yum-rhn-plugin-0.5.2-3.el5  
  3. [root@localhost ~]#   
  搜索后使用如下操作命令删除该软件包,记得要加入nodeps选项进行卸载,不然可能会卸载不成功。

[plain]  view plain copy
  1. [root@localhost ~]# rpm -e --nodeps yum-rhn-plugin-0.5.2-3.el5  
  2. [root@localhost ~]#   


  如此,便可以输入相关命令进行更新了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值