安裝新 CentOS劝评,最先做的兩件事:第一腋逆, 設(shè)置網(wǎng)絡(luò)慕嚷; 第二, 配置 yum 源
1. 虛擬機配置靜態(tài) IP
1.1 VMware 和宿主機設(shè)置 IP
1.2 設(shè)置宿主機網(wǎng)絡(luò)
1.3 設(shè)置虛擬機網(wǎng)絡(luò)
配置靜態(tài)網(wǎng)路
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 結(jié)束生命周期如何切換源] : https://developer.aliyun.com/mirror/centos?spm=a2c4g.11186623.0.0.6b561f024k6qsk