Red Hat 6.5 安装163的 yum

163本地实测yum

# 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-$releasever - 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-$releasever - 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-$releasever - 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-$releasever - 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-$releasever - 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

以下内容转载地址:https://blog.csdn.net/fuwen1989/article/details/51078793 

今天给一个公司搭建LAMP环境,想用前段时间使用的wdCP集成环境,结果遇到个问题,提示相关软件包没有安装,刚好和前一篇文章搭建swoole时遇到的问题一样,就是缺少gcc包而已,但是当运行
yum -y install gcc gcc++ zlib zlib-devel
时悲剧了,提示yum 命令不存在,顿时慌了。。。。。

经过度娘查找,找到安装yum的方法,但是经测试验证2013年前的好多文章已经失效,方法已经不能使用,故记录以备不时之需,

贴步骤:

1.删除redhat原有的yum 
rpm -aq|grep yum|xargs rpm -e --nodeps 

运行这个的时候啥也没显示,就是原装yum也没有,厂商真够省事的啊,跳过。。。

2.下载yum安装文件

以下代码请勿直接复制,核对好路径,注意软件编号,网易还是很负责的,经常更新哟!!!!!!

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm 

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.x86_64.rpm 
rpm -ivh yum-3.2.27-14.el6.centos.noarch.rpm um-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm  
注意最后两个包必需同时安装,否则会相互依赖

4.下载 repo文件

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

5.移动到 /etc/yum.repos.d/ 目录,顺便做了下重命名。原有的.repo文件可以重命名以作备份,感觉后来没用到了,就删掉了。

mv /user/下载/CentOS-Base.repo   /etc/yum.repos.d/rhel-debuginfo.repo
6.运行yum clean all,提示成功

7.运行yum makecache报错了

提示


repomd.xml 路径不正确
8.在官网路径 http://mirrors.163.com/centos/6/os/x86_64/repodata/ 下找到repomd.xml 文件

7.修改源文件

vim /etc/yum.repos.d/rhel-debuginfo.repo
</pre><p></p><div></div><p><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px;">将文件中的$releasever修改为6,所有的$releasever进行批量替换就可以了;</span></p><p></p><p><span style="color: rgb(204, 0, 0); font-family: arial; line-height: 20.02px;"><span style="font-size: 13px;"><span style="color: rgb(51, 51, 51); font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25px;">注意要路径对应哈。</span></span></span></p><p></p><p>8.保存后再运行</p><p></p><pre style="font-size:12.87px; border:1px solid black; margin-top:0px; margin-bottom:0px; padding:10px; width:800px; line-height:19.305px; overflow:auto; background-color:rgb(247,247,247)">yum clean all
yum makecache
你就会看到提示成功缓存成功了。


9.至此再

yum -yinstall gcc gcc-c++ autoconf automake make

yum -yinstall zlib zlib-devel openssl openssl--devel pcre pcre-devel

哈哈,欢快的进度条跑起来了




 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值