由於我是最小化安裝,需要在安裝后進行一些配置
1. 設定啟動級別
[root@home ~]# systemctl set-default multi-user.target
2. 設定網絡
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=no 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=eth0 UUID=54a33101-00eb-41223-9c65-cd7c03adb019 DEVICE=eth0 ONBOOT=yes IPADDR=10.108.1.15 PREFIX=24 GATEWAY=10.108.1.1 DNS1=10.108.1.1 IPV6_PRIVACY=no
3. 由於我是在內網環境使用,所以關閉selinux
[root@home ~]# vi /etc/selinux/config SELINUX=disabled
4. 由於我是在內網環境使用,所以也關閉firewall
[root@home ~]# systemctl stop firewalld.service
[root@home ~]# systemctl disable firewalld.service
5. 設定aliyun作為CentOS yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum makecache
6. 掛載ISO作為RHEL yum源 (Red Hat Enterprise Linux)
[root@home ~]# mkdir /mnt/rhel [root@home ~]# mount -o loop -t iso9660 /opt/rhel-server-7.4-x86_64-dvd.iso /mnt/rhel [root@home ~]# vi /etc/yum.repos.d/rhel.repo [rhel] name=rhel baseurl=file:///mnt/rhel gpgcheck=0 enabled=1 [root@home ~]# yum repolist
7. 安裝常用的軟件
yum -y install yum-utils yum-priorities epel-release yum -y install bind-utils wget vim htop
8. 更新系統
yum -y update