// 阿里源
root# curl -o /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo/repo/fedora.repo
root# curl -o /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo
// 清华源
root# curl -o /etc/yum.repos.d/fedora-tuna.repo https://mirrors.tuna.tsinghua.edu.cn/repo/fedora.repo
root# curl -o /etc/yum.repos.d/fedora-updates-tuna.repo https://mirrors.tuna.tsinghua.edu.cn/repo/fedora-updates.repo
/*
源的名字不能重名不然只会显示一个,列如[fedora],[fedora]俩个源只显示一个要修改其中一个名字
*/
/*
阿里云官方配置文档 https://opsx.alibaba.com/mirror 找到Fedora 后面的帮助
*/
// 在后面加上-opsx
root# vi fedora-opsx.repo
[fedora-opsx]
name=Fedora $releasever - $basearch - aliyun
failovermethod=priority
baseurl=http://mirrors.aliyun.com/fedora/releases/$releasever/Everything/$basearch/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[fedora-debuginfo-opsx]
name=Fedora $releasever - $basearch - Debug - aliyun
failovermethod=priority
baseurl=http://mirrors.aliyun.com/fedora/releases/$releasever/Everything/$basearch/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[fedora-source-opsx]
name=Fedora $releasever - Source - aliyun
failovermethod=priority
baseurl=http://mirrors.aliyun.com/fedora/releases/$releasever/Everything/source/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
// 修改updates 官方的update有问题,需要加上/Everything
root# vi fedora-updates-opsx.repo
[updates-opsx]
name=Fedora $releasever - $basearch - Updates - aliyun
failovermethod=priority
baseurl=http://mirrors.aliyun.com/fedora/updates/$releasever/Everything/$basearch/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[updates-debuginfo-opsx]
name=Fedora $releasever - $basearch - Updates - Debug -aliyun
failovermethod=priority
baseurl=http://mirrors.aliyun.com/fedora/updates/$releasever/Everything/$basearch/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
[updates-source-opsx]
name=Fedora $releasever - Updates Source - aliyun
failovermethod=priority
baseurl=http://mirrors.aliyun.com/fedora/updates/$releasever/Everything/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
/*
清华配置有官方文档,地址 https://mirrors.tuna.tsinghua.edu.cn/help/fedora/
*/
// 给清华源添加名字
root# vi fedora-tuna.repo
[fedora-tuna]
name=Fedora $releasever - $basearch - thu
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/fedora/releases/$releasever/Everything/$basearch/os/
metadata_expire=28d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
// 修改updates
root# vi fedora-updates-tuna.repo
[updates-tuna]
name=Fedora $releasever - $basearch - Updates - thu
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/fedora/updates/$releasever/Everything/$basearch/
enabled=1
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
/*
上面看到你源名字,就代表添加成功,但是有的会显示禁用状态(网上说是源没有这个版本的包)
*/
root# dnf repolist all