0%

CentOS8最小安装后配置

1.开启所有网卡

find /etc/sysconfig/network-scripts/ -type f -path '*/ifcfg-*' | xargs sed -i 's/ONBOOT.*/ONBOOT=yes/g' && systemctl restart network

2.设置镜像源并更新

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
yum makecache

3.安装常用软件

yum install -y \
wget lrzsz zip unzip p7zip screen vim yum-utils bash-completion net-tools bind-utils lsof telnet whois traceroute \
fuse ntfs-3g \
http://download1.rpmfusion.org/free/el/updates/8/x86_64/f/fuse-exfat-1.3.0-3.el8.x86_64.rpm \
http://download1.rpmfusion.org/free/el/updates/8/x86_64/e/exfat-utils-1.3.0-3.el8.x86_64.rpm

4.配置同步时间

sed '3i\pool ntp.ntsc.ac.cn iburst' /etc/chrony.conf 
systemctl enable --now chronyd

5.设置别名

cat >>~/.bashrc<<EOF
alias cp='cp'
alias mv='mv'
alias rm='rm'
alias ll='ls -al --color=auto --time-style=long-iso'
EOF

100.清理临时数据

cp -rf /etc/issue.net /etc/issue
#rm -rf /var/cache/*
echo >/var/log/btmp
echo >/var/log/wtmp
history -c