A local source yum
Mount CD
mount /dev/sr0 /media
Yum source to create a configuration file local.repo (file name Custom)
vim /etc/yum.repos.d/local.repo
[xxx]
name=xxx
baseurl = file: /// media
enabled=1
gpgcheck=0
Yum remove the original information, and then rebuild the cache
yum clean all && yum makecache
Second, the source configuration 163 yum
Backup original image file, so you can recover after an error
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Download the new CentOS-Base.repo file to /etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
Yum remove the original information, and then rebuild the cache
yum clean all && yum makecache
Third, configure yum Ali cloud sources
Backup original image file, so you can recover after an error
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
Download the new CentOS-Base.repo file to /etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
or
-o curl /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
or
-o curl /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
or
-o curl /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Yum remove the original information, and then rebuild the cache
yum clean all && yum makecache
Fourth, the source configuration epel
EPEL (Extra Packages for Enterprise Linux) is built by the Fedora community project to provide high quality software packages for RHEL and derived distributions such as CentOS and so on. Fitted EPEL, the same as in Fedora, you can yum install package name, you can install a lot of software needs to be compiled before installation, commonly used software or some of the more popular software, such as the now popular nginx, htop, ncdu , vnstat etc., can be used EPEL easily install the update.
Currently directly by executing the command: yum -y install EPEL-Release directly installed, this command can not be installed if you can try the following
Backup original image file, so the error can be restored (if configured epel other sources)
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
Download the new epel to /etc/yum.repos.d/
---- EPEL Ali cloud installation source
warm (RHEL 7)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
warm (RHEL 6)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
warm (RHEL 5)
wget -O /etc/yum.repos.d/epel.repohttp://mirrors.aliyun.com/repo/epel-5.repo
---- official source installed directly
CentOS/RHEL 5 :
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
CentOS/RHEL 6 :
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
CentOS/RHEL 7 :
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm