Server系统软件源配置内容解析及相关问题

1、环境

OS:Server 8.3 (衍生自CentOS8.3)
预知知识:
1)软件源(repositories),复数,包含多个软件仓库!
2)软件仓库(repository),单数,代表一个软件仓库!

2、软件源解析

Server8.3的软件源配置位于/etc/yum.repos.d/目录下,其中每个仓库都有一个独立的配置文件。以BaseOS来举例

[root@localhost ~]# more /etc/yum.repos.d/Loongnix-BaseOS.repo 
# Loongnix-BaseOS.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client.  You should use this for Loongnix Server updates unless
# you are manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.

[baseos]
name=Loongnix server $releasever - BaseOS
baseurl=http://x.x.x.x/os/loongnix-server/$releasever/BaseOS/$basearch/release/
gpgcheck=1
enabled=1
priority=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LOONGNIX
  1. 以“#”开头的行代表注释

  2. 从[baseos]开始正式为软件仓库的信息

  3. name :表示这个软件仓库的名字

  4. baseurl :表示软件仓库的地址,具体的目录下要包含软件包和repo信息,如下所示:
    在这里插入图片描述

  5. gpgcheck:是否进行软件包检测(和gpgkey一起使用,确保软件包为官方发布)。1:进行检测,0:不进行检测

  6. enabled :软件仓库是否开启。1:开启,0:关闭,此时不能下载安装此仓库中软件。

  7. priority :优先级,数字越小,优先级越高。(如果优先级一样,安装软件包时默认安装高版本软件包,配置优先级之后,如果同一个软件包在不同仓库中存在不同版本,默认安装高优先级仓库的软件包(而不一定是高版本软件包))

  8. gpgkey :软件包校验文件在系统中的位置。

3 常见问题

3.1 gpg检测问题

在这里插入图片描述

1)此处信息已经提示了读取GPG检测文件失败,此时简单的处理方法是将步骤2中的“gpgcheck=1”修改为“gpgcheck=0”。(正式版本中不推荐这么做!)

posted @   streamlet_hy  阅读(31)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
历史上的今天:
2020-09-03 龙芯3A4000-Debian 10上常用软件记录
点击右上角即可分享
微信分享提示