原因:系统默认的yum源的国外的,下载慢。这里配置国内源,下载快,网络稳定。
准备环境:
hostB:ip 192.168.20.202/2424 网关:192.168.20.254 VMnet8
要求:
使用阿里的yum源进行安装服务
方法:
hostB可以上网(访问外网)
如果不知道怎么配置上网可以参考我的上篇文章
https://blog.csdn.net/weixin_56829498/article/details/127703037?spm=1001.2014.3001.5502
如果没有下载安装wget 请先安装wget (yum install -y wget)
进入目录 cd /etc/yum.repos.d /备份或者移动或者删除 CentOS-Base.repo
下载Centos 7 的阿里云repo 到 /etc/yum.repos.d/CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
清除原有的yum缓存(yum clean all)
生成yum缓存(yum makecache)
通过 yum repolist 查看仓库列表 ========>mirrors.aliyun.com
测试
安装成功。