CentOS下yum安装libmcrypt错误:No package libmcrypt available

错误描述:

yum install libmcrypt libmcrypt-devel

Setting up Install Process
No package libmcrypt available.
No package libmcrypt-devel available.
Error: Nothing to do

我们会看到centos yum从仓库中根本找不到这几个包。但我不想使用源码编译就想使用yum安装,怎么办?
解决方法:

yum install epel-release  //扩展包更新包
yum update //更新yum源

然后再重新

yum install libmcrypt libmcrypt-devel