redhat 6 使用centos源 yum安装

1、删除redhat原有的yum源

# rpm -aq | grep yum|xargs rpm -e --nodeps

2、下载新的yum安装包

  这里我们使用CentOS的yum源

# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-metadata-parser-1.1.2-14.1.el6.i686.rpm
# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
# wget http://mirror.centos.org/centos/6.0/os/i386/Packages/yum-plugin-fastestmirror-1.1.26-1.el6.noarch.rpm

如果wget不了,可以试着到http://mirrors.163.com/centos/6/os/x86_64/Packages/

3、安装yum软件包

# rpm -ivh  python-iniparse-0.3.1-2.1.el6.noarch.rpm
# rpm -ivh  yum-metadata-parser-1.1.2-14.1.el6.i686.rpm
# rpm -ivh  yum-3.2.27-14.el6.centos.noarch.rpm  yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm

  注意:最后两个安装包要放在一起同时安装,否则会提示相互依赖,安装失败。

4、更改yum源  #我们使用网易的CentOS镜像源

# cd /etc/yum.repos.d/
# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo
# vi CentOS6-Base-163.repo

  编辑文件,把文件里面的$releasever全部替换为版本号,即6 最后保存!或者直接把下面的内存拷贝到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

#########################################################################

5、清理yum缓存

# yum clean all
# yum makecache     #将服务器上的软件包信息缓存到本地,以提高搜索安装软件的速度
# yum install vim*    #测试域名是否可用

  至此,Redhat6可以使用CentOS的yum源在线安装软件了!

时间: 2024-10-19 20:57:33

redhat 6 使用centos源 yum安装的相关文章

CentOS 7 yum安装Zabbix

CentOS 7 yum安装Zabbix 一.Zabbix简介 zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案.zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题. 下面是Centos7上yum安装zabbix的步骤. 二.Zabbix安装 本文档在同一台机器上安装了zabbix-server 和zabbix-agent 自己监控自己. 1.配置LAMP 参照下面的链接 Centos

centos 下yum 安装nginx

centos 下yum 安装nginx 1. 直接yum install nginx不行,要先处理下源: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm 2. 查看源: yum info nginx 这时会提示有可安装的软件包 nginx | 2.9 kB 00:00nginx/primary_db | 15 kB 00:00可安装的软件包Nam

centos下yum安装lamp和lnmp轻松搞定

centos下yum安装lamp和lnmp轻松搞定,到底多轻松你看就知道了,妈妈再也不担心不会装lamp了. 很辛苦整理的安装方法,会持续更新下去.凡无法安装的在评论里贴出问题来,会尽快解决.共同维护一个可用yum可用更新. 软件列表:php5.4 apache2.2 mysql5.5 nginx1.8 centos6.x rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ng

Centos下Yum安装PHP5.5,5.6,7.0

Centos下Yum安装PHP5.5,5.6,7.0 默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案: 1.检查当前安装的PHP包 yum list installed | grep php 如果有安装的PHP包,先删除他们 yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 

在Centos中yum安装和卸载软件的使用方法

在Centos中yum安装和卸载软件的使用方法安装方法安装一个软件时yum -y install httpd安装多个相类似的软件时yum -y install httpd*安装多个非类似软件时yum -y install httpd php php-gd mysql卸载一个软件时yum -y remove httpd卸载多个相类似的软件时yum -y remove httpd*卸载多个非类似软件时yum -y remove httpd php php-gd mysql 另外还有一个非常棒的用法假

centos用yum安装mysql-server

centos用yum安装mysql-server 2012-11-09 11:25:09|  分类: Linux|举报|字号 订阅 1.安装:#yum -y install mysql-server 2.修改配置:#vi /etc/my.cnf 暂时修改一下编码(添加在密码下方添加): default-character-set = utf8 3.启动mysql服务,并设定为系统服务: # chkconfig mysqld on ← 设置MySQL服务随系统启动自启动# chkconfig –l

centos下yum安装mysql5.6后,无法启动 MySQL Daemon failed to start

如果是全新安装应该就不会出现这个问题,升级安装的话,要运行 mysql_upgrade ,但是启动MYSQL就报错MySQL Daemon failed to start 如此就没办法运行mysql_upgrade升级MYSQL表了 因为是全新安装的数据库服务器就不管老数据了,直接把老的MYSQL数据库文件夹删除了,然后 运行 mysql_install_db 单独执行下命令,初始化mysql,test等数据库 初始化所有数据库以后,依然是无法启动,检查了MYSQL的日志发现没有权限,因为是RO

在CentOS 中yum 安装Tomcat 6

在linux下部署java开发的web应用,一般采用Tomact+jre环境(可不需要apache),在RHEL和CentOS下,可以采用yum在线自动安装方式安装,具体操作如下: 1.基础环境安装配置    如操作系统(我使用Centos6.3).网络及主机基本配置等 2.yum安装tomcat: yum -y install tomcat6 tomcat6-webapps tomcat6-admin-webapps tomcat6-docs-webapp tomcat6-javadoc yu

centos下yum安装lamp

CentOS下yum安装LAMP   1. 用yum安装Apache,Mysql,PHP. 1.1安装Apache yum install httpd httpd-devel 安装完成后,用/etc/init.d/httpd start 启动apache 设为开机启动:chkconfig httpd on 1.2 安装mysql 1.2.1 yum install mysql mysql-server mysql-devel 同样,完成后,用/etc/init.d/mysqld start 启动