VMware 安装 CentOS 7
2022-11-16 本文已影响0人
我也有键盘
安装新 CentOS,最先做的两件事:第一, 设置网络; 第二, 配置 yum 源
1. 虚拟机配置静态 IP
1.1 VMware 和宿主机设置 IP
1.2 设置宿主机网络
image.png
1.3 设置虚拟机网络
配置静态网路
vim /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="f2941bc2-d106-407f-8325-4e4aba5ae14f"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.10.110
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=114.114.114.114
systemctl restart network
2. 切换 yum 源
cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
-- CentOs 7
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
或
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
-- CentOs 8
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
或
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache
yum -y update
3. 同步时间
ntpdate ntp.aliyun.com
其他链接:
- [CentOS 8 结束生命周期如何切换源] : https://developer.aliyun.com/mirror/centos?spm=a2c4g.11186623.0.0.6b561f024k6qsk