码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 配置YUM

时间:2015-11-07 17:30:35      阅读:342      评论:0      收藏:0      [点我收藏+]

标签:

标签:MYSQL/linux

概述  

文章主要介绍配置yum源,虽然网上有很多方法,但是每个多多少少都有点问题,所以就把自己的配置过程写出来。

目录

步骤

下载安装包

我当前的服务器版本的redhat6,所以下载的安装包也应该是对应linux6的安装包,这里配置的是163的yum源。

 

wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-69.el6.centos.noarch.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/yum-metadata-parser-1.1.2-16.el6.i686.rpm
wget http://mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

卸载自带的yum

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

安装yum包

注意顺序

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 

rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm 

--注意后面两个是一起安装
rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm 

 

技术分享

添加yum

 切换路径

cd /etc/yum.repos.d/

下载文件

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

编辑文件

vim 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/i386/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 测试是否安装成功

yum install perl-DBI

技术分享

 

总结

 安装方法不难,要注意的地方就是下载rpm包的时候要选对版本,还有后面配置repo的时候可能会遇到点麻烦,但都容易解决。

 

 文章如果对大家有帮助,请帮忙推荐,谢谢!!!

 

备注:

    作者:pursuer.chen

    博客:http://www.cnblogs.com/chenmh

本站点所有随笔都是原创,欢迎大家转载;但转载时必须注明文章来源,且在文章开头明显处给明链接,否则保留追究责任的权利。

《欢迎交流讨论》

 

---恢复内容结束---

Linux 配置YUM

标签:

原文地址:http://www.cnblogs.com/chenmh/p/4945586.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!