| 用途 | 配置包管理器的软件源 |
|---|---|
| 语法 | 编辑 .repo 文件 / sources.list |
| 所属 | dnf/yum 与 APT |
yum repo 模板
yum repo 模板
[epel]
name=Extra Packages for Enterprise Linux
baseurl=https://mirrors.example.com/epel/9/Everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9
module_hotfixes=1apt 源模板
apt 源模板
# /etc/apt/sources.list.d/internal.list
deb https://mirrors.example.com/ubuntu noble main restricted universe
deb https://mirrors.example.com/ubuntu noble-updates main restricted生效与验证
生效与验证
dnf repolist -v
dnf config-manager --set-disabled epel # (dnf-plugins-core)
apt update && apt-cache policyGPG 校验(gpgcheck=1)是底线:关校验省事但把供应链风险请进门。