本文使用 VMware 安装 CentOS 7,省略了使用 VMware 新建 CentOS 7 虚拟机的过程,若需要可以阅读另一篇文章:安装 Ubuntu Server
安装
- 安装 CentOS 7
- 选择语言(建议选择英文)
-
设置安装位置,默认即可
-
设置 Root 账户密码
如果密码过于简单,需要点两次
Done
-
等待安装完成
重启~
配置
-
激活网卡
- 查看 ip 地址
> ip addr
发现只有一个本地回环地址,
ens33
网卡需要手动激活- 激活网卡
> vi /etc/sysconfig/network-scripts/ifcfg-ens33 ONBOOT=yes // 将 no 改为 yes > service network restart // 重启网络服务
网卡已激活
-
安装
ifconfig
命令,因为安装的是Minimal
最小安装包版,所以需要自己手动安装命令> yum install net-tools
-
安装
wget
yum -y install wget
-
配置软件源
-
备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
-
下载新的 ContOS-Base.repo 到 /etc/yum.repos.d
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
-
生成缓存
yum clean all
yum makecache
-
-
关闭防火墙
-
查看防火墙状态
firewall-cmd --state running // 若是 running,说明防火墙已开启,需要关闭
-
关闭防火墙
systemctl stop firewalld.service
-
禁止开机重启
systemctl disable firewalld.service
-