查看Linux系统版本的命令
[root@localhost yum.repos.d]# cat /etc/redhat-release
CentOS release 6.3 (Final)
去阿里巴巴开发者社区找到CentOS的yum源:
阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区 (aliyun.com)
centos6的yum源下载(前提:Linux能连接上网络)
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
或者
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo
非阿里云ECS用户会出现 Couldn't resolve host 'mirrors.cloud.aliyuncs.com' 信息,不影响使用。用户也可自行修改相关配置: eg:
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
运行生成缓存
yum makecache
超级的L先生