avatar

刘刚刚的blog

采菊东篱下,悠然见南山🦥

  • 首页
  • python
  • 大模型应用
  • 软件/工具导航页
  • 关于
Home <linux就该这么学>RHEL8配置软件仓库
文章

<linux就该这么学>RHEL8配置软件仓库

Posted 2021-06-27 Updated 2024-12- 17
By Administrator
5~7 min read

RHEL8配置软件仓库


RHEL8配置软件仓库(yum源)

  1. 给虚拟机添加光盘文件

    image-20210329233613218

  2. 挂载光盘文件到目录

    # 创建挂载点
    mkdir /media/cdrom
    
    # 挂载
    [root@localhost media]# vim /etc/fstab
    ## 在最后添加如下内容
    /dev/cdrom /media/cdrom iso9660 defaults 0 0
    [root@localhost media]# mount -a
    mount: /media/cdrom: WARNING: device write-protected, mounted read-only.
    
    
  3. 配置yum仓库的文件

    # 进入目录
    [root@localhost media]# cd /etc/yum.repos.d/
    # yum配置文件的名称随意,结尾为repo即可
    [root@localhost media]# vim readhat.repo
    
    # 写入文件内容
    [BaseOS]
    name=BaseOS
    baseurl=file:///media/cdrom/BaseOS
    gpgheck=0
    enabled=1
    [AppStream]
    name=AppStream
    baseurl=file:///media/cdrom/AppStream
    gpgcheck=0
    enabled=1
    
  4. 使用yum /dnf安装软件

    yum  install 软件包名称

tip:

如果出现以下错误:

[root@localhost media]# dnf install tmux
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

You have enabled checking of packages via GPG keys. This is a good thing.
However, you do not have any GPG public keys installed. You need to download
the keys for packages you wish to install and install them.
You can do that by running the command:
 rpm --import public.gpg.key

可以使用rpm --import public.gpg.key解决

配置阿里云yum源的方式

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

当有多个yum源存在时,linux提供有配置优先级的插件(需要安装)

运维
linux就该这么学
License:  CC BY 4.0
Share

Further Reading

Jun 18, 2025

一些开发中使用的 linux运维命令

查看目录下的文件或者文件夹大小 du -d 1 -h 杀死某些服务 pkill -f flask-search lsof -i :5000 | awk 'NR>1 {print $2}' | xargs kill -9

Jun 8, 2025

ollama-大模型的部署与使用

linux curl -fsSL https://ollama.com/install.sh | sh 因为安装过程有使用github相关资源,国内访问会有问题,需要加速。或者使用docker进行安装。各大云平台都有提供docker加速方法。 ollama的所有命令 Available Comman

Feb 5, 2025

Docker的常用命令

Docker的常用命令 # 镜像列表 docker images ​ # 容器列表 docker ps # 设置镜像源 ​ # 进入容器内部 docker exec -it {容器id} /bin/bash #或者 docker exec -it {容器id} /bin/sh # 查看镜

OLDER

<linux就该这么学>第九章 使用ssh管理远程主机

NEWER

<linux就该这么学> 第10章 使用Apache服务部署静态网站

Recently Updated

  • 使用 claude api遇到的问题
  • 一些开发中使用的 linux运维命令
  • python包管理神器:UV
  • ollama-大模型的部署与使用
  • 为jupyter增加可选的python内核

Trending Tags

Halo 运维 postgresql 设计模式 linux就该这么学 nas rag odoo python 文本切分

Contents

©2025 刘刚刚的blog. Some rights reserved.

Using the Halo theme Chirpy