最小安装版安装后
- 没有网络,ping www.baidu.com 不通
vi /etc/sysconfig/network-scripts/ifcfg-ens33
![]()
- 将
ONBOOT=no
修改为ONBOOT=yes
- 执行
service network restart
重启网络
- 替换阿里镜像源
- 备份:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
- 下载阿里镜像源(注意 curl 和 wget 后面参数选项的大小写):
1)curl-o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2)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源:
yum repolist enabled
yum repolist all
- 没有 wget 工具
yum install -y wget
- 使用
rpm
命令安装,使用阿里镜像源下载安装包 https://opsx.alibaba.com/mirror,找到 wget 工具
![]()
- 使用
curl
命令下载后curl -O https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/wget-1.14-18.el7.x86_64.rpm
- 使用
rpm
命令安装:rpm -ivh wget-1.14-18.el7.x86_64.rpm
网友评论