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
-
以“#”开头的行代表注释
-
从[baseos]开始正式为软件仓库的信息
-
name :表示这个软件仓库的名字
-
baseurl :表示软件仓库的地址,具体的目录下要包含软件包和repo信息,如下所示:
![在这里插入图片描述]()
-
gpgcheck:是否进行软件包检测(和gpgkey一起使用,确保软件包为官方发布)。1:进行检测,0:不进行检测
-
enabled :软件仓库是否开启。1:开启,0:关闭,此时不能下载安装此仓库中软件。
-
priority :优先级,数字越小,优先级越高。(如果优先级一样,安装软件包时默认安装高版本软件包,配置优先级之后,如果同一个软件包在不同仓库中存在不同版本,默认安装高优先级仓库的软件包(而不一定是高版本软件包))
-
gpgkey :软件包校验文件在系统中的位置。
3 常见问题
3.1 gpg检测问题

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


浙公网安备 33010602011771号