CentOS7初使用

1,配置静态IP

【CentOS7初使用】1,虚拟机设置为桥接
2,ipconfig查看win物理机的ip,网关,子网掩码,DNS
3,vi /etc/sysconfig/network-scripts/ifcfg-ens33(ens33每个人可能不一样)
修改行BOOTPROTO=static#修改成static
修改行ONBOOT=yes#修改成yes
添加行IPADDR=192.168.1.100#物理机同一网段的IP
添加行NETMASK=255.255.255.0#物理机一样的子网掩码
添加行GETWAY=192.168.1.1#物理机一样的网关
添加行DNS1=192.168.1.1#物理机一样的DNS 一般为路由器的地址
4,添加网关地址:vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=起个名字
GATEWAY=192.168.1.1#物理机一样的网关
5,添加DNSvi /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.1.1 #和物理机一样
6,重启 service network restart
2,配置yum源
cd/etc/yum.repos.d/
wgethttp://mirrors.aliyun.com/repo/Centos-7.repo
mvCentOS-Base.repo CentOS-Base.repo.bak
mv Centos-7.repo CentOS-Base.repo
yum clean all
yum makecache
yum update
3,安装python3
yum install gcc openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel tk-devel wget curl-devel
cd /tmp
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
tar -zxvf Python-3.7.2.tgz
mkdir /usr/local/python3
Python-3.7.2/configure --prefix=/usr/local/python3/
make
make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3


    推荐阅读