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
相关推荐
A小辣椒1 天前
TShark:Wireshark CLI 功能
linux
A小辣椒1 天前
TShark:基础知识
linux
AlfredZhao1 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao2 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334662 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪2 天前
linux 拷贝文件或目录到指定的位置
linux
大树883 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠3 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质3 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush43 天前
嵌入式linux学习记录十四、术语
linux·嵌入式