一、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=
baseurl=
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=
baseurl=
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=
baseurl=
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=
baseurl=
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=
baseurl=
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
#清缓存
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
阅读(1033) | 评论(0) | 转发(0) |