Yum installation error Error:Nothing to Do

Error message

No package nginx available
Error:Nothing to do

method one,
replacement source

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

CentOS 7

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

Run Yum Makecache to generate the cache
Method 2:
use EPEL to install nginx:
sudo yum install epel-release
yum update
yum install nginx

Read More: