Linux下的软件管理

1.软件的类型

压缩包(绿色安装包、源码编译)

DEB(类DEBIN)

RPM(类RHEL)

2.利用镜像搭建本地软件仓库

复制代码
[root@localhost ~]# mkdir  /rhel9				#挂载光驱读取镜像内容
[root@localhost ~]# mount /dev/cdrom   /rhel9/	#手动挂载光驱
[root@localhost ~]# vim /etc/rc.d/rc.local		#开启自动运行mount动作实现自动挂载
mount /dev/cdrom   /rhel9/

	
[root@localhost ~]# chmod +x /etc/rc.d/rc.local


#设定软件仓库指向
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim rhel.repo
[AppStream]
name = AppStream
baseurl = file:///rhel9/AppStream
gpgcheck = 0

[BaseOS]
name = BaseOS
baseurl = file:///rhel9/BaseOS
gpgcheck = 0

#检测软件仓库是否可用
[root@localhost yum.repos.d]# dnf list httpd
正在更新 Subscription Management 软件仓库。
无法读取客户身份

本系统尚未在权利服务器中注册。可使用 "rhc" 或 "subscription-manager" 进行注册。

AppStream                                                             82 MB/s | 7.7 MB     00:00
BaseOS                                                               155 MB/s | 2.1 MB     00:00
可安装的软件包
httpd.x86_64                                  2.4.62-4.el9                                  AppStream

3.网络软件仓库的使用

eg:

#加载docker容器网络软件仓库的使用的网络repo源过程:

镜像地址:

https://mirrors.aliyun.com/docker-ce/linux/rhel/9.6/x86_64/stable/

复制代码
[root@localhost entries]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
redhat.repo  rhel.repo
[root@localhost yum.repos.d]# vim docker.repo
[root@localhost yum.repos.d]# cat docker.repo
[docker]
name  = docker
baseurl = https://mirrors.aliyun.com/docker-ce/linux/rhel/9.6/x86_64/stable/   ***import
gpgcheck = 0

url链接直接复制镜像网站想获取的镜像http地址即可

测试:

复制代码
[root@localhost yum.repos.d]# dnf search docker
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:01:31 ago on Thu 15 Jan 2026 07:27:49 AM EST.
=================================== Name & Summary Matched: docker ====================================
docker-buildx-plugin.x86_64 : Docker Buildx plugin for the Docker CLI
docker-ce-rootless-extras.x86_64 : Rootless support for Docker
docker-compose-plugin.x86_64 : Docker Compose plugin for the Docker CLI
docker-model-plugin.x86_64 : Docker Model Runner plugin for the Docker CLI
pcp-pmda-docker.x86_64 : Performance Co-Pilot (PCP) metrics from the Docker daemon
podman-docker.noarch : Emulate Docker CLI using podman
======================================== Name Matched: docker =========================================
docker-ce.x86_64 : The open-source application container engine
docker-ce-cli.x86_64 : The open-source application container engine

#epel源的使用

#epel源的地址:

https://mirrors.aliyun.com/epel-archive/9.6-2025-11-11/Everything/x86_64/

复制代码
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim epel.repo
[root@localhost yum.repos.d]# cat epel.repo
[epel]
name = epel
baseurl = https://mirrors.aliyun.com/epel-archive/9.6-2025-11-11/Everything/x86_64/
gpgcheck = 0

测试:

复制代码
[root@localhost yum.repos.d]# dnf search ansible
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

epel                                                                   1.9 MB/s |  20 MB     00:10    
Last metadata expiration check: 0:00:10 ago on Thu 15 Jan 2026 07:39:41 AM EST.
=================================== Name & Summary Matched: ansible ===================================
ansible.noarch : Curated set of Ansible collections included in addition to ansible-core
ansible-collection-ansible-posix.noarch : Ansible Collection targeting POSIX and POSIX-ish platforms
ansible-collection-ansible-utils.noarch : Ansible Network Collection for Common Code
ansible-collection-ansible-windows.noarch : Windows core collection for Ansible
ansible-collection-awx-awx.noarch : Ansible modules and plugins for working with AWX
ansible-collection-chocolatey-chocolatey.noarch : Ansible collection for Chocolatey
ansible-collection-community-crypto.noarch : The community.crypto collection for Ansible
ansible-collection-community-docker.noarch : Ansible modules and plugins for working with Docker
ansible-collection-community-general.noarch : Modules and plugins supported by Ansible community
ansible-collection-community-mysql.noarch : MySQL collection for Ansible
ansible-collection-community-postgresql.noarch : Manage PostgreSQL with Ansible
ansible-collection-community-rabbitmq.noarch : RabbitMQ collection for Ansible
ansible-collection-containers-podman.noarch : Podman Ansible collection for Podman containers
ansible-collection-mdellweg-filters.noarch : An Ansible collection of random filters I missed at some
                                           : point
ansible-collection-microsoft-sql.noarch : The Ansible collection for Microsoft SQL Server management
ansible-collection-netbox-netbox.noarch : Netbox modules for Ansible
ansible-collection-redhat-rhel_mgmt.noarch : Ansible Collection of general system management and
                                           : utility modules and other plugins
ansible-freeipa-collection.noarch : freeipa.ansible_freeipa collection
ansible-freeipa-tests.noarch : ansible-freeipa tests
ansible-packaging.noarch : RPM packaging macros and generators for Ansible collections
ansible-packaging-tests.noarch : Dependencies for Ansible collection package unit tests
ansible-pcp.noarch : Ansible Metric collection for Performance Co-Pilot
ansible-srpm-macros.noarch : SRPM stage RPM packaging macros for Ansible collections
ansible-test.x86_64 : Tool for testing ansible plugin and module code
python3-ansible-lint.noarch : Best practices checker for Ansible
python3-ansible-pylibssh.x86_64 : Python bindings specific to Ansible use case for libssh
python3-pytest-testinfra+ansible.noarch : Metapackage for python3-pytest-testinfra: ansible extras
vim-ansible.noarch : Vim plugin for syntax highlighting ansible's common filetypes
======================================== Name Matched: ansible ========================================
ansible-collection-community-libvirt.noarch : Manages virtual machines supported by libvirt
ansible-collection-pulp-pulp_installer.noarch : A collection of roles to install or upgrade Pulp 3
ansible-collection-pulp-pulp_installer-doc.noarch : Documentation for the pulp.pulp_installer
                                                  : collection
ansible-core.x86_64 : SSH-based configuration management, deployment, and task execution system
ansible-freeipa.noarch : Roles and playbooks to deploy FreeIPA servers, replicas and clients
====================================== Summary Matched: ansible =======================================
rhc-worker-playbook.x86_64 : Python worker for Red Hat connector that launches Ansible Runner
standard-test-roles.noarch : Standard Test Interface Ansible roles
相关推荐
爱喝水的鱼丶13 小时前
SAP-ABAP:ECC→S/4HANA ABAP 迁移升级指南——程序改造、语法兼容与性能优化 导语
运维·开发语言·性能优化·sap·abap·经验交流·开发交流
木子欢儿13 小时前
openconnect Linux客户端安装 以及开机自启和登录
linux·运维·服务器
..Dauntless..14 小时前
【Linux】文件系统(一)
linux·运维·服务器
天空属于哈夫克314 小时前
企业微信API二次开发 赋能私域运营自动化
运维·自动化·企业微信
天远API14 小时前
零信任架构实战:基于天远运营商二要素V即时版构建自动化分时租赁出行会员身份一致性审核网关
运维·人工智能·架构·自动化
九零HTTP14 小时前
10月21号-CSDN配菜-IP池的5个坑
服务器·数据库·tcp/ip
SHENGWEI胜为14 小时前
交换机端口显示正常,终端却获取不到 IP 地址?从 DHCP 流程定位故障
服务器·网络·测试工具·缓存·通信工程
极光通讯14 小时前
液冷服务器对内存和SSD的适配要求:高密度部署下的散热与信号完整性
运维·服务器
2501_9377671616 小时前
面向设计 / 研发部门:终端文件统一归档 + 服务器定时备份实践
运维·安全
GeW16 小时前
新质生产力路线图:从Linux到数据库,企业落地要点都在这
linux