虚拟机镜像源获取(阿里镜像站点CentOS7.9最小化安装包)
1.1、安装后配置系统环境
关闭selinux
getenforce #查看selinux服务状态
vi /etc/selinux/config
SELINUX=enforcing #修改为"SELINUX=disabled"
[root@docker ~]# getenforce
Disabled
关闭防火墙
systemctl stop firewalld #临时停止防火墙
systemctl status firewalld #查看防火墙状态
systemctl disable firewalld #关闭防火墙开机自启动
iptables –F #清理防火墙规则
iptables –L #查看防火墙规则
[root@docker ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
配置升级阿里云YUM源以及epel扩展源
#备份源
[root@docker ~]# mkdir -p /etc/yum.repos.d/repo-bak
[root@docker ~]# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo-bak/
[root@docker ~]# ls /etc/yum.repos.d/
repo-bak
#更换阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#更新epel源
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
#清理缓存
yum clean all
#重新生成缓存
yum makecache
#安装部分工具
yum install -y bash-completion vim lrzsz wget expect net-tools nc nmap tree dos2unix htop iftop iotop unzip telnet sl psmisc nethogs glances bc ntpdate openldap-devel
#安装中文包
[root@docker ~]# yum groupinstall "fonts"
1.2、查看系统相关信息
#查看系统版本号
[root@docker ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@docker ~]# cat /proc/version
Linux version 3.10.0-1160.71.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Tue Jun 28 15:37:28 UTC 2022
#查看系统位数
[root@docker ~]# getconf LONG_BIT
64
#查看主机名
[root@docker ~]# hostname
docker
#查看CPU信息
[root@docker ~]# cat /proc/cpuinfo
[root@docker ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
4 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
#查看系统内存使用情况
[root@docker ~]# free -m
total used free shared buff/cache available
Mem: 3788 135 3550 8 103 3482
Swap: 8191 0 8191
[root@docker ~]# cat /proc/meminfo
#查看Linux系统负载信息
[root@docker ~]# uptime -V
uptime from procps-ng 3.3.10
[root@docker ~]# uptime
22:51:31 up 26 min, 1 user, load average: 0.00, 0.01, 0.02
#检查设置静态网卡信息
[root@docker ~]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static" #设置静态IP模式
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="enp0s3"
UUID="6e10c78f-cc57-4e49-a983-64622b73c9d9"
DEVICE="enp0s3"
ONBOOT="yes" #这里如果为no的话就改为yes,表示网卡设备自动启动
IPADDR=192.168.18.150 #配置ip地址
NETMASK=255.255.255.0
GATEWAY=192.168.18.1
#重启网卡服务
[root@docker ~]# /etc/init.d/network restart
#修改全局DNS
[root@docker ~]# vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.18.1
nameserver 8.8.8.8
#查看系统是否有安装中文语言包 (列出所有可用的公共语言环境的名称,包含有zh_CN)
[root@docker ~]# locale -a |grep "zh_CN"
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
[root@docker ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"
[root@docker ~]# echo $LANG
en_US.UTF-8