更换为阿里云的源

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


wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo


yum makecache


下载rpm包,但是不安装:

yum install sshpass-1.05-1.el6.x86_64  -y --downloadonly --downloaddir=/usr/local/


参考:http://zhangge.net/4222.html


卸载已经安装的rpm包

两个关键点:

1.如果提示有xxx.rpm包已经被installed了,那么先用rpm -e  --nodeps xxx来卸载

2.如果存在多个版本的话,用rpm -e --allmatches来卸载

rpm -e --nodeps openssl-devel-1.0.1e-48.el6_8.1.x86_64


安装软件包的时候,如果不方便解决依赖关系,可以这么做:

sh install.sh
#!/usr/bin
rpm -ivh ./*.sh