0%

CentOS8最小安装后配置

1.开启所有网卡

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

2.设置镜像源并更新

1
2
3
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.安装常用软件

1
2
3
4
5
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.配置同步时间

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

5.设置别名

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

100.清理临时数据

1
2
3
4
5
cp -rf /etc/issue.net /etc/issue
#rm -rf /var/cache/*
echo >/var/log/btmp
echo >/var/log/wtmp
history -c
  • 本文作者: 6x
  • 本文链接: https://6xyun.cn/article/105
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-ND 许可协议。转载请注明出处!