Chinaunix首页 | 论坛 | 博客
  • 博客访问: 609592
  • 博文数量: 66
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1810
  • 用 户 组: 普通用户
  • 注册时间: 2013-07-23 13:53
个人简介

linux

文章分类

全部博文(66)

文章存档

2016年(1)

2015年(14)

2014年(32)

2013年(19)

分类: LINUX

2014-11-17 11:18:40

最近想在red hat enterprise linux server release 6.0跑个程序,需要安装一些软件,但redhat的yum在线更新是收费的,所以配置了一个CentOS的源,记录一下;

1.确认redhat的版本
  1. # less /etc/redhat-release
2.删除redhat原有的yum源
  1. # rpm -qa | grep yum |xargs rpm -e --nodeps
3.下载CentOS的yum安装包
  1. #wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
  2. # wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
  3. # wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
  4. # wget http://mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
注意:
第1点:如果下载显示
Resolving mirrors.163.com... 123.58.173.106
Connecting to mirrors.163.com|123.58.173.106|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-11-16 18:28:09 ERROR 404: Not Found.
这种错误说明,该包以废弃了,需要下在响应的包;
地址:
第2点:看机器是32bit--i386 还是64bit的--x86_64
4.安装yum软件包
  1. # rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
  2. warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
  3. Preparing... ########################################### [100%]
  4.         package python-iniparse-0.3.1-2.1.el6.noarch is already installed
  5. # rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
  6. warning: yum-metadata-parser-1.1.2-16.el6.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
  7. Preparing... ########################################### [100%]
  8.    1:yum-metadata-parser ########################################### [100%]
  9. # rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
  10. warning: yum-3.2.29-60.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
  11. Preparing... ########################################### [100%]
  12.    1:yum-plugin-fastestmirro########################################### [ 50%]
  13.    2:yum ########################################### [100%]
注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。
5.更改yum源(网易的CentOs镜像源)
  1. #cd /etc/yum.repos.d/
  2. #vi CentOS6-Base-163.repo
  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client.  You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #
  12. [base]
  13. name=CentOS-6 - Base - 163.com
  14. baseurl=http://mirrors.163.com/centos/6/os/$basearch/
  15. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
  16. gpgcheck=1
  17. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  18. #released updates
  19. [updates]
  20. name=CentOS-6 - Updates - 163.com
  21. baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
  22. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
  23. gpgcheck=1
  24. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  25. #additional packages that may be useful
  26. [extras]
  27. name=CentOS-6 - Extras - 163.com
  28. baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
  29. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
  30. gpgcheck=1
  31. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  32. #additional packages that extend functionality of existing packages
  33. [centosplus]
  34. name=CentOS-6 - Plus - 163.com
  35. baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
  36. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
  37. gpgcheck=1
  38. enabled=0
  39. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  40. #contrib - packages by Centos Users
  41. [contrib]
  42. name=CentOS-6 - Contrib - 163.com
  43. baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
  44. #mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
  45. gpgcheck=1
  46. enabled=0
  47. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
6.清理
  1. # yum clean all
7.测试
  1. # yum install vim
    Loaded plugins: fastestmirror
    Setting up Install Process
    Determining fastest mirrors
    base                                                              | 3.7 kB     00:00     
    ^Cbase/primary_db                3% [-                   ]  17 kB/s | 138 kB     03:29 ET
OK.搞定:)
阅读(2550) | 评论(0) | 转发(0) |
0

上一篇:快速排序

下一篇:vim

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