阿里云开源镜像站

yum -y install wget

备份原镜像文件,便于后期恢复

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

2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/
Centos5地址:

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

Centos6地址:

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

Centos7地址:

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

清除缓存

yum clean all

生成缓存

yum makecache

初始化安装一些命令

yum -y install vim tcpdump lsof net-tools lrzsz net-tools bash-* telnet bind-utils gcc c++ ntpdate

下载yum源包,但是不安装,如果服务器安装了插件,那么下载时候可能会漏包

yum install yum-downloadonly
yum install yum-plugin-downloadonly
yum install unixODBC --downloadonly --downloaddir=/usr/local/src
#            软件名                                      保存目录   
yum localinstall * -y

例如,安装lrzsz

# 会吧lrzsz所需要的依赖包都下载至服务器/usr/local/src/目录下,如果以及安装了lrzsz,那么下载下来的依赖包会缺失
yum install lrzsz--downloadonly --downloaddir=/usr/local/src

¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥
有问题评论区回复,或者私信
¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥