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 @   老王教你学Linux  阅读(400)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示