CentOS7配置yum源

一. 配置本地源

假定本地光盘位于/root/CentOS-7-x86_64-DVD-1511.iso 

1、mkdir /media/cdrom

2、mount -t iso9660 /root/CentOS-7-x86_64-DVD-1511.iso /media/cdrom/

3、cd /etc/yum.repos.d

4、mv *.repo bak/

5、vim CentOS-Media.repo

# CentOS-Media.repo
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/cdrom
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

 

二. 配置网络yum源

1、cd /etc/yum.repos.d

2、mv *.repo bak/

3、wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

4、yum clean all

5、yum repolist

posted @ 2017-11-21 09:10  himismad  阅读(660)  评论(0编辑  收藏  举报