Linux 软件包管理(二)
Linux 软件包管理二源码安装软件源码安装 nginx介绍Nginx是一个高性能的HTTP和反向代理web服务器。官方地址https://nginx.org安装# 安装依赖[rootcentos7 ~]# yum install gcc make pcre-devel zlib-devel# 下载[rootcentos7 ~]# wget https://nginx.org/download/nginx-1.24.0.tar.gz# 解压[rootcentos7 ~]# tar -xf nginx-1.24.0.tar.gz# 配置[rootcentos7 ~]# cd nginx-1.24.0/[rootcentos7 ~]# ./configure --prefix/usr/local/nginx# 将所有的nginx相关文件存放在/usr/local/nginx# 编译安装[rootcentos7 nginx-1.24.0]# make make install[rootserver ~10:11:53]# ls /usr/local/nginx/client_body_temp conf fastcgi_temp html logs proxy_temp sbin scgi_temp uwsgi_temp#查看tree[rootserver nginx-1.24.0 09:44:12]# tree /usr/local/nginx/usr/local/nginx|-- conf||-- fastcgi.conf||-- fastcgi.conf.default||-- fastcgi_params||-- fastcgi_params.default||-- koi-utf||-- koi-win||-- mime.types||-- mime.types.default||-- nginx.conf||-- nginx.conf.default||-- scgi_params||-- scgi_params.default||-- uwsgi_params||-- uwsgi_params.default|-- win-utf|-- html||-- 50x.html|-- index.html|-- logs-- sbin-- nginx4directories,18files# 配置环境变量[rootserver nginx-1.24.0 09:44:28]# echo $PATH/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin[rootserver nginx-1.24.0 09:44:50]# PATH$PATH:/usr/local/nginx/sbin/使用# 启动服务[rootserver nginx-1.24.0 09:47:12]# nginx[rootserver nginx-1.24.0 09:47:22]# ps -C nginxPID TTY TIME CMD9322? 00:00:00 nginx9323? 00:00:00 nginx# 验证[rootserver nginx-1.24.0 09:48:32]# echo Welcome myz /usr/local/nginx/html/index.html[rootserver nginx-1.24.0 09:49:49]# curl localhostWelcome myz# 退出服务[rootserver ~10:08:47]# nginx -s quit[rootserver ~10:11:46]# ps -C nginxPID TTY TIME CMD命令总结nginx启动服务nginx -s quit待nginx进程处理任务完毕进行停止。nginx -s stop查出nginx进程id再使用kill命令强制杀掉进程。nginx -s reload重新加载服务。配置nginx服务[rootcentos7 ~]# cp /usr/lib/systemd/system/sshd.service /etc/systemd/system/nginx.service[rootcentos7 ~]# vim /etc/systemd/system/nginx.service[Unit]DescriptionNginx server daemon[Service]TypeforkingExecStart/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.confExecReload/usr/local/nginx/sbin/nginx-sreloadExecStop/usr/local/nginx/sbin/nginx-squit[Install]WantedBymulti-user.target[rootcentos7 ~]# systemctl daemon-reload[rootcentos7 ~]# systemctl enable nginx.service --now源码安装 cmatrix介绍Cmatrix 是一款 Linux 环境下的炫酷屏保软件其效果类似于黑客帝国电影中的代码雨。项目地址https://github.com/abishekvashok/cmatrix安装# 安装依赖包[rootcentos7 ~]# yum -y install gcc make autoconf ncurses-devel# 下载[rootcentos7 ~]# wget https://jaist.dl.sourceforge.net/project/cmatrix/cmatrix/1.2/cmatrix-1.2.tar.gz# 解压[rootcentos7 ~]# tar -xf cmatrix-1.2.tar.gz# 配置软件[rootcentos7 ~]# cd cmatrix-1.2/[rootcentos7 cmatrix-1.2]# ./configure --prefix/usr/local/cmatrix# 编译并安装[rootcentos7 cmatrix-1.2]# make make install使用# 配置环境变量[rootcentos7 ~]# export PATH$PATH:/usr/local/cmatrix/bin# 帮助信息[rootcentos7 ~]# cmatrix --helpUsage: cmatrix -[abBfhlsVx][-u delay][-C color]-a: Asynchronous scroll -b: Bold characters on -B: All bold characters(overrides -b)-f: Force the linux$TERMtypeto be on -l: Linux mode(uses matrix console font)-o: Use old-style scrolling -h: Print usage andexit-n: No bold characters(overrides-band -B, default)-s:Screensavermode, exits on first keystroke -x: X window mode, useifyour xterm is using mtx.pcf -V: Print version information andexit-udelay(0-10, default4): Screen update delay-C[color]: Use this colorformatrix(default green)# 执行[rootcentos7 ~]# cmatrix# 效果如下[rootcentos7 ~]# cmatrix -b -u 3 -C red# -b 加粗字体# -u 滚动速度# -C 字体颜色 绿色green、红色red、蓝色blue、白色white、黄色yellow、青色cyan、洋红色magenta以及黑色black这些颜色。随时改变颜色当然你无需重新启动程序就可以随时改变显示的颜色。但需要记住不同的键位对应着不同的颜色。在 Cmatrix 未关闭的情况下如果你按下了存储在键位上的指令显示的颜色将会直接变更。颜色相应键位对应数字键红色!shift1绿色shift2黄色#shift3蓝色$shift4洋红色%shift5青色^shift6白色shift7黑色)shift8自由调整速度在 Cmatrix 运行的过程中你可以按0到9的任何一位数字键来随意改变当前的更新速度。自建仓库自建仓库流程准备软件包创建仓库索引信息发布仓库客户端配置验证详细操作步骤[rootserver ~]# mkdir rpms[rootserver ~]# cd rpms# 下载软件包以及依赖的软件包[rootserver rpms]# yum install --downloadonly --downloaddir . vim open-vm-tools vsftpd lrzsz bash-completion nginx httpd mariadb-server# 移动软件包到发布目录[rootserver ~]# mkdir /usr/local/nginx/html/tools[rootserver ~]# mv rpms /usr/local/nginx/html/tools/Packages# 安装创建仓库软件包[rootserver ~]# yum install -y createrepo# 创建仓库索引信息[rootserver ~]# createrepo /usr/local/nginx/html/tools/[rootserver ~]# vim /usr/local/nginx/conf/nginx.conf# 在http块中新增一行autoindex on# 作用提供文件清单http{autoindex on;.....# 重启nginx服务[rootserver ~]# systemctl reload nginx# 备份原有仓库[rootclient ~11:36:24]# mkdir /etc/yum.repos.d/old[rootclient ~11:37:07]# mv /etc/yum.repos.d/*repo /etc/yum.repos.d/old# 添加新仓库[rootclient ~11:37:12]# cat EOF /etc/yum.repos.d/tools.repo[tools]namecentos7 tools from server.laoma.cloudbaseurlhttp://server.laoma.cloud/tools/enabled1gpgcheck0EOF[rootclient ~11:37:47]# ls /etc/yum.repos.d/backup epel.repo.rpmnew old tools.repo# 安装软件包[rootclient ~]# yum install -y httpd同步仓库# 将仓库中软件包和元数据全部同步到本地[rootclient ~]# reposync --repoidtools --download-metadata[rootclient ~]# createrepo tools[rootclient ~]# ls tools/Packages repodata.repo.rpmnew old tools.repo安装软件包[rootclient ~]# yum install -y httpd## 同步仓库 bash # 将仓库中软件包和元数据全部同步到本地 [rootclient ~]# reposync --repoidtools --download-metadata [rootclient ~]# createrepo tools [rootclient ~]# ls tools/ Packages repodata参考yum-REPOSYNC(8)。

相关新闻

NVIDIA显卡驱动安装更新-Windows系统

NVIDIA显卡驱动安装更新-Windows系统

NVIDIA显卡驱动安装&更新-Windows系统 前言 很多人装 PyTorch 报 GPU 不可用、CUDA 不匹配,本质都是版本链条没对齐。 完整依赖关系如下: 显卡硬件决定了可支持的驱动版本上限 → 安装好的 NVIDIA 显卡驱动,决定了系统可支持的最高 CUDA …

2026/7/30 15:19:39 阅读更多 →
一键备份QQ空间历史记录:GetQzonehistory完整指南

一键备份QQ空间历史记录:GetQzonehistory完整指南

一键备份QQ空间历史记录:GetQzonehistory完整指南 【免费下载链接】GetQzonehistory 获取QQ空间发布的历史说说 项目地址: https://gitcode.com/GitHub_Trending/ge/GetQzonehistory 你是否曾担心QQ空间里的青春记忆随着时间流逝而消失?那些记录着…

2026/7/30 15:19:39 阅读更多 →
深度解析modern-screenshot:Web端高质量截图解决方案实战手册

深度解析modern-screenshot:Web端高质量截图解决方案实战手册

深度解析modern-screenshot:Web端高质量截图解决方案实战手册 【免费下载链接】modern-screenshot 📸 Quickly generate image from DOM node using HTML5 canvas and SVG. 项目地址: https://gitcode.com/gh_mirrors/mo/modern-screenshot 在当今…

2026/7/30 15:18:39 阅读更多 →

最新新闻

Trae/Vs Code/Cursor命令行无法跑npm命令

Trae/Vs Code/Cursor命令行无法跑npm命令

Trae/Vs Code/Cursor命令行无法跑npm命令?一篇搞定所有踩坑指南 如果你是前端开发者,大概率遇到过这样一个让人抓狂的场景:打开 VS Code、Cursor 或者 Trae(字节跳动推出的 AI IDE),在终端里熟练地敲下 np…

2026/7/30 15:26:42 阅读更多 →
多账号运营痛点与系统化解决方案

多账号运营痛点与系统化解决方案

1. 多账号运营的常见痛点与根源分析 运营多个Instagram账号时,内容管理混乱是90%的团队都会遇到的典型问题。我经手过的跨境电商业态中,平均每个运营人员需要同时管理3-5个不同定位的账号,这些账号往往在三个月内就会出现发布内容错位、互动数…

2026/7/30 15:26:42 阅读更多 →
A星与DWA融合算法在机器人路径规划中的Matlab实现

A星与DWA融合算法在机器人路径规划中的Matlab实现

1. 项目背景与核心价值 在机器人路径规划领域,全局规划与局部避障的协同一直是个经典难题。A星算法作为全局路径规划的黄金标准,能够找到起点到目标点的最优路径,但对动态环境反应迟钝;而DWA算法擅长实时避障,却容易陷…

2026/7/30 15:25:42 阅读更多 →
WPF中使用路由模式处理Mqtt消息

WPF中使用路由模式处理Mqtt消息

直接上代码 特征[AttributeUsage(AttributeTargets.Method, AllowMultiple true, Inherited false)]public class MqttTopicAttribute : Attribute{public string Topic { get; }/// <summary>/// 描述&#xff08;可选&#xff0c;用于日志/文档&#xff09;/// </…

2026/7/30 15:25:42 阅读更多 →
Java开发环境搭建与配置实战指南

Java开发环境搭建与配置实战指南

1. Java开发环境搭建全攻略 第一次接触Java开发的朋友们&#xff0c;最头疼的莫过于环境搭建这个"入门仪式"。作为一个从2008年就开始用Java的老码农&#xff0c;我见过太多新手在环境配置上栽跟头。今天我就把十几年积累的环境搭建经验&#xff0c;用最直白的方式分…

2026/7/30 15:25:42 阅读更多 →
从零实现Python智能体:思维链、工具调用与记忆机制详解

从零实现Python智能体:思维链、工具调用与记忆机制详解

在AI技术快速发展的今天&#xff0c;Agent&#xff08;智能体&#xff09;已成为连接大语言模型与现实应用的重要桥梁。很多开发者一提到Agent开发就想到使用现成框架&#xff0c;但框架往往隐藏了底层原理&#xff0c;让初学者难以真正理解Agent的工作机制。本文将从零开始&am…

2026/7/30 15:25:42 阅读更多 →

日新闻

Windows驱动存储终极清理工具:DriverStoreExplorer完全指南

Windows驱动存储终极清理工具:DriverStoreExplorer完全指南

Windows驱动存储终极清理工具&#xff1a;DriverStoreExplorer完全指南 【免费下载链接】DriverStoreExplorer Driver Store Explorer 项目地址: https://gitcode.com/gh_mirrors/dr/DriverStoreExplorer 您是否曾因Windows系统盘空间不足而烦恼&#xff1f;是否遇到过设…

2026/7/30 0:00:13 阅读更多 →
如何3步掌握Video Download Helper:网页视频下载的完整实战指南

如何3步掌握Video Download Helper:网页视频下载的完整实战指南

如何3步掌握Video Download Helper&#xff1a;网页视频下载的完整实战指南 【免费下载链接】VideoDownloadHelper Chrome Extension to Help Download Video for Some Video Sites. 项目地址: https://gitcode.com/gh_mirrors/vi/VideoDownloadHelper 你是否曾经在浏览…

2026/7/30 0:00:13 阅读更多 →
“双减”后首个AI备课压力测试报告:覆盖32所中小学的176节AI辅助课,暴露4大隐性增负节点

“双减”后首个AI备课压力测试报告:覆盖32所中小学的176节AI辅助课,暴露4大隐性增负节点

更多请点击&#xff1a; https://intelliparadigm.com 第一章&#xff1a;AI 教师备课辅助 AI 教师备课辅助系统正逐步成为教育数字化转型的核心支撑工具&#xff0c;它并非替代教师&#xff0c;而是通过语义理解、知识图谱与多模态生成能力&#xff0c;将教师从重复性劳动中解…

2026/7/30 0:00:13 阅读更多 →

周新闻

深度学习道路桥梁裂缝检测系统 道路桥梁裂缝检测数据集 道路桥梁病害识别检测数据集

深度学习道路桥梁裂缝检测系统 道路桥梁裂缝检测数据集 道路桥梁病害识别检测数据集

深度学习道路桥梁裂缝检测系统 数据集6000张 完整源码已标注数据集训练好的模型环境配置教程程序运行说明文档&#xff0c;可以直接使用&#xff01;系统支持图片、视频、摄像头等多种方式检测裂缝&#xff0c;功能强大实用。 1数据集6000张 8各类别

2026/7/29 22:18:20 阅读更多 →
深度学习YOLO模型如何训练 PUBG 绝地求生目标检测数据集

深度学习YOLO模型如何训练 PUBG 绝地求生目标检测数据集

pubg数据集 精选原图1.42万数据 1.49万标签 无任何重复、算法增强或冗余图像&#xff01; pubg绝地求生目标检测数据集 1分类&#xff1a;e_body&#xff0c;14905个标签&#xff0c;txt格式 共计14244张图&#xff0c;99%为640*640尺寸图像 适合yolo目标检测、AI训练关键词&am…

2026/7/29 14:34:28 阅读更多 →
Apex英雄目标检测数据集 深度学习框架YOLO如何训练APEX数据集

Apex英雄目标检测数据集 深度学习框架YOLO如何训练APEX数据集

Apex检测数据集数据集详情检测类别&#xff1a; allies enemy tag图片总量&#xff1a;7247张训练集&#xff1a;5139张验证集&#xff1a;1425张测试集&#xff1a;683张标注状态&#xff1a;全部已标注&#xff0c;即拿即用数据格式&#xff1a;支持YOLO格式及其他格式&#…

2026/7/29 15:00:03 阅读更多 →

月新闻