最近想在red hat enterprise linux server release 6.0跑个程序,需要安装一些软件,但redhat的yum在线更新是收费的,所以配置了一个CentOS的源,记录一下;
1.确认redhat的版本
-
# less /etc/redhat-release
2.删除redhat原有的yum源
-
# rpm -qa | grep yum |xargs rpm -e --nodeps
3.下载CentOS的yum安装包
-
#wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
-
# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
-
# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
-
# 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软件包
-
# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
-
warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
-
Preparing... ########################################### [100%]
-
package python-iniparse-0.3.1-2.1.el6.noarch is already installed
-
# rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
-
warning: yum-metadata-parser-1.1.2-16.el6.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
-
Preparing... ########################################### [100%]
-
1:yum-metadata-parser ########################################### [100%]
-
# rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
-
warning: yum-3.2.29-60.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
-
Preparing... ########################################### [100%]
-
1:yum-plugin-fastestmirro########################################### [ 50%]
-
2:yum ########################################### [100%]
注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。
5.更改yum源(网易的CentOs镜像源)
-
#cd /etc/yum.repos.d/
-
#vi CentOS6-Base-163.repo
-
# CentOS-Base.repo
-
#
-
# 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-6 - Base - 163.com
-
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
-
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
-
gpgcheck=1
-
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
#released updates
-
[updates]
-
name=CentOS-6 - Updates - 163.com
-
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
-
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
-
gpgcheck=1
-
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
#additional packages that may be useful
-
[extras]
-
name=CentOS-6 - Extras - 163.com
-
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
-
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
-
gpgcheck=1
-
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
#additional packages that extend functionality of existing packages
-
[centosplus]
-
name=CentOS-6 - Plus - 163.com
-
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
-
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
-
gpgcheck=1
-
enabled=0
-
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
-
#contrib - packages by Centos Users
-
[contrib]
-
name=CentOS-6 - Contrib - 163.com
-
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
-
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
-
gpgcheck=1
-
enabled=0
-
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
6.清理
7.测试
-
# 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) |