Chinaunix首页 | 论坛 | 博客
  • 博客访问: 179549
  • 博文数量: 111
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 790
  • 用 户 组: 普通用户
  • 注册时间: 2010-12-29 13:41
  • 认证徽章:
文章分类

全部博文(111)

文章存档

2018年(10)

2017年(27)

2016年(18)

2015年(31)

2014年(25)

分类: 系统运维

2015-12-27 21:00:01

一、CentOS6.5创建本地YUM下载源:
1、创建挂载和存放ios目录:
   mkdir -p /mnt/cdrom /mnt/centosyum
2、将ios挂载到/mnt/cdrom目录下
   mount -t /dev/cdrom /mnt/cdrom
3、将挂载目录下所有内容拷贝到/mnt/centosyum
    cp -fr /mnt/cdrom/* /mnt/centosyum
4、配置本地yum
     cd /etc/yum.repos.d/
     mv CentOS-Base.repo CentOS-Base.repo.bak
     mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak
     mv CentOS-Vault.repo CentOS-Vault.repo.bak
     vim CentOS-Media.repo
###########
    [c6-media]
     name=CentOS-$releasever - Media
     baseurl=file:///mnt/centosyum  #本地源
                file:///media/cdrom/
                file:///media/cdrecorder/
      gpgcheck=1 #检查GPG-KEY,0为不检查,1为检查
      enabled=1   #使用此yum源(0为不启用,1为启用)
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
###########
     yum clean all #清除yum缓存
     yum list        #显示yum安装包列表
、CentOS6.5网络YUM下载源:
1、
添加DNS:
    vim /etc/resolv.conf
    #####
    nameserver 202.106.0.20
     nameserver 8.8.8.8
    #####
2、系统自带配置不需更改(系统自带centos6官方下载源)。
    /etc/yum.repos.d
    CentOS-Base.repo  
    CentOS-Debuginfo.repo
    CentOS-Media.repo  
    CentOS-Vault.repo
三、其它yum网络源
     163网络源:
############
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


#released updates 
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


###########

阿里云yum源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
#清缓存
yum clean all
#建缓存
yum makecache

 cd /etc/yum.repos.d/

2 mv CentOS-Base.repo CentOS-Base.repo123

3 mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo123

4 mv CentOS-Media.repo CentOS-Media.repo123

 cd /etc/yum.repos.d/

2 mv CentOS-Base.repo CentOS-Base.repo123

3 mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo123

4 mv CentOS-Media.repo CentOS-Media.repo123

阅读(534) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册