RHEL6.5使用CENTOS的YUM源
2014-06-03 09:05
525 查看
未注册的RHEL无法更新,出现This system is not registered with RHN,每次挂载本地源很麻烦,有些特殊的包本地源中还不一定有,一般都采用Centos的源进行替换。
解决方案主要包括两部分,一是卸载RHEL的YUM,安装同版本的CENTOS版YUM,二是设置yum的网络源,特别是加入国内的源以加快速度。
1.卸载
[plain] view
plaincopy
[root@localhost]# rpm -qa | grep yum
PackageKit-yum-0.5.8-21.el6.x86_64
yum-3.2.29-40.el6.noarch
yum-utils-1.1.30-14.el6.noarch
yum-plugin-security-1.1.30-14.el6.noarch
yum-rhn-plugin-0.9.1-48.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
PackageKit-yum-plugin-0.5.8-21.el6.x86_64
[root@localhost]# rpm -qa | grep yum| xargs rpm -e --nodeps
[root@localhost]# yum install php
bash: /usr/bin/yum: No such file or directory
2.下载Centos的yum安装包
[plain] view
plaincopy
[root@localhost ~]#wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
[root@localhost ~]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@localhost ~]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[root@localhost ~]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@localhos ~t]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/RPM-GPG-KEY-CentOS-6
3.安装Centos的yum
[plain] view
plaincopy
[root@localhost ~]# 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
[root@localhost ~]# rpm --import RPM-GPG-KEY-CentOS-6
[root@localhost ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [100%]
[root@localhost ~]# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm
error: Failed dependencies:
yum-plugin-fastestmirror is needed by yum-3.2.29-40.el6.centos.noarch
[root@localhost ~]# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Preparing... ########################################### [100%]
1:yum-plugin-fastestmirro########################################### [ 50%]
2:yum ########################################### [100%]
4.更新yum源
[plain] view
plaincopy
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
local.repo packagekit-media.repo rhel-source.repo
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2014-05-17 16:36:38-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolving mirrors.163.com... 123.58.173.106
Connecting to mirrors.163.com|123.58.173.106|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2006 (2.0K) [application/octet-stream]
Saving to: “CentOS6-Base-163.repo”
100%[======================================>] 2,006 --.-K/s in 0.02s
2014-05-17 16:36:38 (98.0 KB/s) - “CentOS6-Base-163.repo” saved [2006/2006]
需要将 CentOS6-Base-163.repo 文档中的$releasever占位符替换为本地系统的版本号6.5
本人用vi编辑,在末行模式下输入:%s/$releasever/6.5/g替换整个文件下的$releasever为6.5,替换成功后会提示15 次替换,共 15 行的字样,最后保存退出。
最后清除并重建缓存 yum clean all & yum makecache
[plain] view
plaincopy
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: Local base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Determining fastest mirrors
Local | 3.9 kB 00:00 ...
Local/group_gz | 204 kB 00:00 ...
Local/filelists_db | 3.8 MB 00:00 ...
Local/primary_db | 3.1 MB 00:00 ...
Local/other_db | 1.6 MB 00:00 ...
base | 3.7 kB 00:00
base/group_gz | 220 kB 00:03
base/filelists_db | 5.9 MB 00:11
base/primary_db | 4.4 MB 00:10
base/other_db | 2.8 MB 00:04
extras | 3.4 kB 00:00
extras/filelists_db | 11 kB 00:00
extras/prestodelta | 907 B 00:00
extras/primary_db | 19 kB 00:00
extras/other_db | 5.8 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 1.9 MB 00:01
updates/prestodelta | 275 kB 00:00
updates/primary_db | 3.1 MB 00:02
updates/other_db | 26 MB 00:32
Metadata Cache Created
[root@localhost yum.repos.d]#
解决方案主要包括两部分,一是卸载RHEL的YUM,安装同版本的CENTOS版YUM,二是设置yum的网络源,特别是加入国内的源以加快速度。
1.卸载
[plain] view
plaincopy
[root@localhost]# rpm -qa | grep yum
PackageKit-yum-0.5.8-21.el6.x86_64
yum-3.2.29-40.el6.noarch
yum-utils-1.1.30-14.el6.noarch
yum-plugin-security-1.1.30-14.el6.noarch
yum-rhn-plugin-0.9.1-48.el6.noarch
yum-metadata-parser-1.1.2-16.el6.x86_64
PackageKit-yum-plugin-0.5.8-21.el6.x86_64
[root@localhost]# rpm -qa | grep yum| xargs rpm -e --nodeps
[root@localhost]# yum install php
bash: /usr/bin/yum: No such file or directory
2.下载Centos的yum安装包
[plain] view
plaincopy
[root@localhost ~]#wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
[root@localhost ~]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@localhost ~]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[root@localhost ~]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@localhos ~t]# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/RPM-GPG-KEY-CentOS-6
3.安装Centos的yum
[plain] view
plaincopy
[root@localhost ~]# 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
[root@localhost ~]# rpm --import RPM-GPG-KEY-CentOS-6
[root@localhost ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [100%]
[root@localhost ~]# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm
error: Failed dependencies:
yum-plugin-fastestmirror is needed by yum-3.2.29-40.el6.centos.noarch
[root@localhost ~]# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Preparing... ########################################### [100%]
1:yum-plugin-fastestmirro########################################### [ 50%]
2:yum ########################################### [100%]
4.更新yum源
[plain] view
plaincopy
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
local.repo packagekit-media.repo rhel-source.repo
[root@localhost yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
--2014-05-17 16:36:38-- http://mirrors.163.com/.help/CentOS6-Base-163.repo
Resolving mirrors.163.com... 123.58.173.106
Connecting to mirrors.163.com|123.58.173.106|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2006 (2.0K) [application/octet-stream]
Saving to: “CentOS6-Base-163.repo”
100%[======================================>] 2,006 --.-K/s in 0.02s
2014-05-17 16:36:38 (98.0 KB/s) - “CentOS6-Base-163.repo” saved [2006/2006]
需要将 CentOS6-Base-163.repo 文档中的$releasever占位符替换为本地系统的版本号6.5
本人用vi编辑,在末行模式下输入:%s/$releasever/6.5/g替换整个文件下的$releasever为6.5,替换成功后会提示15 次替换,共 15 行的字样,最后保存退出。
最后清除并重建缓存 yum clean all & yum makecache
[plain] view
plaincopy
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: Local base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Determining fastest mirrors
Local | 3.9 kB 00:00 ...
Local/group_gz | 204 kB 00:00 ...
Local/filelists_db | 3.8 MB 00:00 ...
Local/primary_db | 3.1 MB 00:00 ...
Local/other_db | 1.6 MB 00:00 ...
base | 3.7 kB 00:00
base/group_gz | 220 kB 00:03
base/filelists_db | 5.9 MB 00:11
base/primary_db | 4.4 MB 00:10
base/other_db | 2.8 MB 00:04
extras | 3.4 kB 00:00
extras/filelists_db | 11 kB 00:00
extras/prestodelta | 907 B 00:00
extras/primary_db | 19 kB 00:00
extras/other_db | 5.8 kB 00:00
updates | 3.4 kB 00:00
updates/filelists_db | 1.9 MB 00:01
updates/prestodelta | 275 kB 00:00
updates/primary_db | 3.1 MB 00:02
updates/other_db | 26 MB 00:32
Metadata Cache Created
[root@localhost yum.repos.d]#
相关文章推荐
- RHEL6.5系统默认不支持yum源,将红帽系统的yum源改成CentOS的yum源,可以免费使用
- RHEL/CentOS 6.x使用EPEL6与remi的yum源安装MySQL 5.5.x
- rhel5.8使用centos5.8 yum源
- RHEL 6.4使用CentOS 6.4 yum源更新-x86_64的脚本
- RHEL使用centos的yum源
- centos6.5使用光盘作为本地的yum源
- RHEL X86_64 6.0使用CentOS6.0的yum源
- RHEL5使用CentOS 5.3的yum源
- RHEL 6.4使用CentOS 6.4 yum源更新-i386的脚本
- RHEL使用Centos的YUM源
- 使用Linux命令行测试网速以及rhel使用Centos仓库 , 企业实际应用之同步远程yum源到本地
- 仍然是yum问题-rhel6使用centos的yum源
- 使用163.com的Centos6 yum源,更新RHEL6系统
- RHEL/CentOS 6.x使用EPEL6与remi的yum源安装MySQL 5.5.x
- RHEL5.4使用CentOS5.4的yum源
- RHEL/CentOS 6.x使用EPEL6与remi的yum源安装MySQL 5.5.x
- RHEL使用CentOS的yum源
- RHEL5.4使用CentOS5.4的yum源
- rhel6.3使用centos的Yum源
- RHEL/CentOS 6.x使用EPEL6与remi的yum源安装MySQL 5.5.x