一、设置静态IP
CentOS6:
使用vi编辑器编辑:vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.223.*
NETMASK=255.255.255.0
GATEWAY=192.168.223.2
然后重启网卡,命令:service network restart
CentOS7:
使用vi编辑器编辑:vi /etc/sysconfig/network-scripts/ifcfg-ens33
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.223.*
NETMASK=255.255.255.0
GATEWAY=192.168.223.2
然后重启网卡,命令systemctl restart network
二、配置yum源
-
cd /etc/yum.repos.d/
-
mkdir bak
-
mv Cen* bak’
-
ls 只有有个bak文件
-
vi yum.repo
{[CentOS7.6]
name=CentOS7.6
baseurl=file:///media
gpgcheck=0
enabled=1
} -
mount /dev/sr0 /media/
-
yum makecache
-
yum install *