Centos配置yum源

centos6.x
cd /etc/yum.repos.d/
\cp CentOS-Base.repo CentOS-Base.repo.$(date +%F)
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
eple源
yum -y install epel-release

centos7.x
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all
yum makecache

RHEL 官方扩展源
yum -y install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install epel-release

yum install 软件名:   安装软件

安装软件下载的软件包路径: /var/cache/yum/x86_64/7/extras/packages

但是默认情况下下载的软件包是安装完成立即删除

 /etc/yum.conf                  keepcache=1    //设置安装软件后不删除安装包

你可能感兴趣的:(linux)