yum源配置

1.配置网路yum源

    yum配置文件在 /etc/yum.repos.d 下

    http://mirrors.163.com/.help/centos.html、 网易yum源地址 


    更改yum源

    下载配置文件  wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

    将此配置文件替换/etc/yum.repos.d下 *.repo 文件

    编辑配置文件

    #cd /etc/yum.repos.d

    #vi CentOS6-Base-163.repo

    将文件中$releasever全部改成对应版本(6/6.5)

wKiom1X6dXyw50fCAAHw_3NINh4246.jpg

清理yum缓存

#yum clean all

将服务器软件包信息缓存至本地,提高搜索安装效率

#yum makecache

上面两条命令有报错,一般为配置文件更改不对,可根据错误信息查找更改配置文件中错误

完成

2.配置本地yum源


配置本地yum源需要安装 yum-metadata-parser*.rpm 包

1、挂载系统安装光盘

# mount /dev/cdrom /mnt/cdrom/

2、配置本地yum源

# cd /etc/yum.repos.d/

CentOS-Media.repo 是yum 本地源的配置文件

修改CentOS-Media.repo

# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  CentOS-5.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c5-media [command]
#  
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c5-media [command]
 
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///mnt/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

在baseurl 中修改第2个路径为/mnt/cdrom(即为光盘挂载点)

将enabled=0改为1

3、禁用默认的yum 网络源

将yum 网络源配置文件改名为CentOS-Base.repo.bak,否则会先在网络源中寻找适合的包,改名之后直接从本地源读取。


其他国内yum源列表如下:

1. 企业贡献:
搜狐开源镜像站:http://mirrors.sohu.com/
网易开源镜像站:http://mirrors.163.com/

2. 大学教学:
北京理工大学:
http://mirror.bit.edu.cn (IPv4 only)
http://mirror.bit6.edu.cn (IPv6 only)
北京交通大学:
http://mirror.bjtu.edu.cn (IPv4 only)
http://mirror6.bjtu.edu.cn (IPv6 only)
http://debian.bjtu.edu.cn (IPv4+IPv6)
兰州大学:http://mirror.lzu.edu.cn/
厦门大学:http://mirrors.xmu.edu.cn/
清华大学:
http://mirrors.tuna.tsinghua.edu.cn/ (IPv4+IPv6)
http://mirrors.6.tuna.tsinghua.edu.cn/ (IPv6 only)
http://mirrors.4.tuna.tsinghua.edu.cn/ (IPv4 only)
天津大学:http://mirror.tju.edu.cn/
中国科学技术大学:
http://mirrors.ustc.edu.cn/ (IPv4+IPv6)
http://mirrors4.ustc.edu.cn/
http://mirrors6.ustc.edu.cn/
东北大学:
http://mirror.neu.edu.cn/ (IPv4 only)
http://mirror.neu6.edu.cn/ (IPv6 only)
电子科技大学:http://ubuntu.uestc.edu.cn/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章