1、为centos添加EPEL源

rpm -ivh http://mirror.cogentco.com/pub/linux/epel/6/i386/epel-release-6-7.noarch.rpm

2、安装optipng

yum install optipng