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
技术是没有终点的,也是学不完的,最重要的是活着、不秃。 学习看书还是看视频,都不重要,重要的是学会,欢迎关注,我们的目标---不秃。
---更多运维开发交流及软件包免费获取请加V: Linuxlaowang
分类:
Linux基础知识
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .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 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义