centos8 优化

centos8 基础优化

  • 1.设置系统时间为北京时间
一、设置时区
[root@centos8 ~]# timedatectl set-timezone Asia/Shanghai
[root@centos8 ~]# rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp-release-centos.noarch.rpm
二、添加 wlnmp yum源
[root@centos8 ~]# yum install wntp -y     #安装工具
[root@centos8 ~]# ntpdate ntp1.aliyun.com #使用阿里云时间服务器同步时间
[root@centos8 ~]# uptime                  #查看时间
[root@centos8 ~]# uptime
 09:39:21 up 2 days, 14:21,  1 user,  load average: 0.05, 0.01, 0.00
  • 2.安装基础软件包
# 安装wget:
yum -y install wget zip unzip tar net-tools vim -y
  • 3.配置yum源
# ps:阿里云服务基本可以跳过此步骤
# 下载阿里yum源repo文件
[root@centos8 ~]# wget http://mirrors.aliyun.com/repo/Centos-8.repo -P /etc/yum.repos.d/
# 备份其他.repo
[root@centos8 ~]# mkdir /etc/yum.repos.d/repo_backup -p
[root@centos8 ~]# mv /etc/yum.repos.d/CentOS-Linux-* /etc/yum.repos.d/repo_backup/
# 清空缓存
[root@centos8 ~]# yum clean all
# 生成缓存
[root@centos8 ~]# yum makecache -y
# 更新软件
[root@centos8 ~]# yum update -y
# 查看yum源
[root@centos8 ~]# yum repolist enabled
  • 4.系统优化
#关闭selinux
sed -i '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config
#调整单个进程最大能打开文件的数量
echo '* - nofile 65535' >> /etc/security/limits.conf
posted @ 2021-11-29 11:16  老王教你学Linux  阅读(367)  评论(0编辑  收藏  举报