redhat ent6.5使用centos yum
转载自:http://blog.csdn.net/zhngjan/article/details/20843465
搜狐镜像库:mirrors.sohu.com
163镜像库:mirrors.163.com
查看系统信息:
[admin@server1 ~]$ uname -a
Linux server1 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
在使用redhat linux的yum来安装或者更新软件的时候会提示
- [admin@server1 ~]$ sudo yum install gcc
- Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
- This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
- Setting up Install Process
- No package gcc available.
- Error: Nothing to do
[注]请以root身份操作
由于 redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源
解决办法:
1、首先到http://mirrors.163.com/centos下载软件包
## x86 地址:http://mirrors.163.com/centos/6/os/i386/Packages/
## x86_64 地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/
## 必要下载的软件包有(以64位系统为例):
python-iniparse-0.3.-2.1.el6.noarch.rpm
yum-3.2.-.el6.centos.noarch.rpm
yum-metadata-parser-1.1.-.el6.x86_64.rpm
yum-plugin-fastestmirror-1.1.-.el6.noarch.rpm
下载命令:
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
[注] :版本不一定要最新的(http://mirrors.163.com/centos/6/os/x86_64/Packages/ 查找对应版本)
2、卸载RedHat自带的yum
rpm -qa | grep yum | xargs rpm -e --nodeps
注:1> xargs是一条Unix和类Unix操作系统的常用命令。它的作用是将参数列表转换成小块分段传递给其他命令,以避免参数列表过长的问题
2> --nodeps 强制卸载,不管依赖性
3、安装下载的centos的yum包:
rpm -ivh python-iniparse-0.3.-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.-.el6.x86_64.rpm
rpm -ivh yum-3.2.-.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.-.el6.noarch.rpm
[注] :最后2个需要一起安装,否则会出现依赖性错误
4、到http://mirrors.163.com的 centos帮助文档 中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repo.d中
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
5、编辑CentOS6-Base-163.repo文件,将其中的$releasever更改为centos的版本号
下面是修改好的:
# 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- - Base - .com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS- - Updates - .com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS- - Extras - .com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS- - Plus - .com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS- - Contrib - .com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
6、yum clean all 清除原有缓存
7、yum makecache 获取yum列表
出现下面提示,表示yum更改完成:
Metadata Cache Created
脚本:
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH # Check if user is root
if [ $(id -u) != "" ]; then
echo "Error: You must be root to run this script"
exit
fi clear
echo "========================================================================="
echo "Replace Redhat Enterprise Yum to CentOS Yum and Repos, Written by Licess"
echo "=========================================================================" # uninstall rhel yum
echo "Uninstall Rhel Yum......"
rpm -qa|grep yum|xargs rpm -e --nodeps
# delete old rpm
echo "Clean old cache......"
rm -rf python-iniparse-0.3.-2.1.el6.noarch.rpm
rm -rf yum-metadata-parser-1.1.-.el6.x86_64.rpm
rm -rf yum-3.2.-.el6.centos.noarch.rpm
rm -rf yum-plugin-fastestmirror-1.1.-.el6.noarch.rpm # download CentOS Yum
echo "Download Python-iniparse......"
wget http://mirrors.163.com/centos/6. ... -2.1.el6.noarch.rpm echo "Download yum-metadata-parse......"
wget http://mirrors.163.com/centos/6. ... 2-16.el6.x86_64.rpm echo "Download yum......"
wget http://mirrors.163.com/centos/6. ... 6.centos.noarch.rpm echo "Download yum fastmirror......"
wget http://mirrors.163.com/centos/6. ... 0-14.el6.noarch.rpm # install CentOS Yum
echo "Installing......"
rpm -ivh python-iniparse-0.3.-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.-.el6.x86_64.rpm
rpm -ivh yum-3.2.-.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.-.el6.noarch.rpm # replace repos
## 将修改改好的CentOS6-Base-163.repo 拷贝到/etc/yum.repo.d/中
##然后执行下面命令
yum clean all
yum makecache
yum update echo "=========================================================================="
echo "You have successfully replace RedhatEnterprise Yum to CentOS yum and repos"
echo "=========================================================================="
redhat ent6.5使用centos yum的更多相关文章
- redhat centos yum源的安装
redhat centos yum源的安装 1.除旧 #cd /etc/yum.repos.d #mv rhel-debuginfo.repo rhel-debuginfo.repo.bak 此处将其 ...
- Redhat 6 配置CentOS yum source
由于最近曝出linux的bash漏洞,想更新下bash,于是 想到了配置CentOS yum source. 测试bash漏洞的命令: env x='() { :;}; echo "Your ...
- redhat下yum命令安装(替换为centos yum命令)
redhat默认自带的yum源需要注册,才能更新,报错:This system is not registered to Red Hat Subscription Management. You ca ...
- RedHat 更新CentOS Yum源(转)
经测试,可用.转自:https://www.cnblogs.com/tangsen/p/5151994.html 一.随笔引言 1.1随笔内容: 1.RedHat 配置Centos yum源 2.yu ...
- Redhat6.5使用centos yum源
新安装了redhat6.5.安装后,登录系统,使用yum update 更新系统.提示:This system is not registered to Red Hat Subscription Ma ...
- centos yum源配置 与yum配置文件
参考博客 http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html 1.centos . yum配置文件在目录 /etc/yum.re ...
- redhat7.4 使用centos yum源
新安装了redhat7.4安装后,登录系统,使用yum update 更新系统.提示: This system is not registered to Red Hat Subscription Ma ...
- CentOS yum源设定使用方法的整理(转)
CentOS yum更新了很多版本更新,我本人认为CentOS yum很好使的文件系统,在此向大家推荐CentOS应该是做为服务器的linux的佼佼者.CentOS采用的二进制包是rpm,不过包的依赖 ...
- 卸载Redhat 7自带的yum,安装并使用网易163源
由于redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,安装CentOS yum工具,再配置其他源,以下为详细过程:删除redhat原有的yum ...
随机推荐
- Hibernate开发环境搭建
一.下载Hibernate包的下载 官网地址:http://hibernate.org/orm/ 下载版本:hibernate-release-4.3.11.Final 二.Hibernate jar ...
- 操作系统开发之——一个简单的Bootsect
先吓唬一下读者朋友呵呵,直接发代码:(这是UOS操作系统的Bootsect)(有兴趣的朋友能够增加我们,联系方式在最后) ;------------------------------ ;文件名称:B ...
- 11-spring学习-表达式语言
1,表达式语言的操作形式以及处理流程. 2,在spring中各种表达式字符串的编写. SPEL(spring Express language) 表达式入门 观察一下表达式: 范例:表达式操作 1)基 ...
- 基于Node.js + WebSocket 的简易聊天室
代码地址如下:http://www.demodashi.com/demo/13282.html Node.js聊天室运行说明 Node.js的本质就是运行在服务端的JavaScript.Node.js ...
- j2ee高并发时使用全局变量需要注意的问题
原文:https://blog.csdn.net/jston_learn/article/details/21617311 开发中,全局变量的使用很频繁,但对于多线程的访问,使用全局变量需要注意的地方 ...
- 安装Drupal7.12升级至7.22
怀揣着为中小企业量身定做一整套开源软件解决方案的梦想开始了一个网站的搭建.http://osssme.org/ [2013-08-11] 资料更新,Drupal 7.22升级至7.23 访问自己的Dr ...
- 转 Activity的四种LaunchMode(写的真心不错,建议大家都看看)
我们今天要讲的是Activity的四种launchMode. launchMode在多个Activity跳转的过程中扮演着重要的角色,它可以决定是否生成新的Activity实例,是否重用已存在的 ...
- c语言中有bool型变量吗?
C语言里面是没有bool(布尔)类型的,C++里面才有,这就是说,在C++里面使用bool类型是没有问题的. bool类型有只有两个值:true =1 .false=0. 但是,C99标准里面,又定义 ...
- Lintcode---二叉树的层次遍历(原型)
给出一棵二叉树,返回其节点值的层次遍历(逐层从左往右访问) 您在真实的面试中是否遇到过这个题? Yes 样例 给一棵二叉树 {3,9,20,#,#,15,7} : 3 / \ 9 20 / \ 15 ...
- django学习笔记【001】django版本的确定&创建一个django工程
2.3 查看当前的django版本 python3. -m django --version 2.3.1 创建一个django工程 django-admin startproject mysite 在 ...