centos 7 配置yum源

yum:

全称为 Yellowdog Updater, Modified)是一个在Fedora和RedHat以及CentOS中的Shell前端软件包管理器。基于RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。

配置网络yum源:

1、备份原始yum源

cd /etc/yum.repos.d

mv CentOS-Base.repo Centos-Base.repo.bak

2、配置centos的DNS:

vim /etc/resolv.conf

nameserver 114.114.114.114   //国内dns

nameserver  8.8.8.8   //国外dns

3、下载yum文件,代替原始yum源

网易yum源:

wget  -O   /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

yum clean all  //清除缓存

yum makecache   //生成缓存

wget -o ,使用-o参数来指定一个文件名

阿里云yum源:

wget   -O   /etc/yum.repos.d/CentOS-Base.repo    http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all

yum makecache

配置EPEL源:

yum -y install epel-release

yum clean all

yum makecache

以上三部就配置好了epel源

猜你喜欢

转载自www.cnblogs.com/s-p-l/p/10632318.html