Fedora 的软件源配置文件可以有多个,其中:系统默认的 fedora
仓库配置文件为 /etc/yum.repos.d/fedora.repo
,系统默认的 updates
仓库配置文件为 /etc/yum.repos.d/fedora-updates.repo
。
# Fedora必装的第1个源:rpmfusion(https://rpmfusion.org/Configuration)
Fedora 22 或以后的版本,执行以下命令:
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
另外:https://rpmfusion.org/Howto 此处有几个其他常用软件的源的安装方法包括virtualbox和NVIDIA的驱动等等。
## 第2个:Fedora 软件源——ustc(中国科学技术大学).
地址:https://mirrors.ustc.edu.cn/fedora/
收录架构:x86_64, i386
收录版本:(2017.4)所有仍在支持的版本和最新测试版本.
使用说明:
将以下保存为 fedora-ustc.repo
:
[fedora] name=Fedora $releasever - $basearch - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/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] name=Fedora $releasever - $basearch - Debug - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/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] name=Fedora $releasever - Source - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/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
将以下保存为 fedora-updates-ustc.repo
:
[updates] name=Fedora $releasever - $basearch - Updates - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/fedora/updates/$releasever/$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] name=Fedora $releasever - $basearch - Updates - Debug -ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/fedora/updates/$releasever/$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] name=Fedora $releasever - Updates Source - ustc failovermethod=priority baseurl=https://mirrors.ustc.edu.cn/fedora/updates/$releasever/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
先备份 /etc/yum.repos.d/fedora.repo
和 /etc/yum.repos.d/fedora-updates.repo
将 fedora-ustc.repo
和 fedora-updates-ustc.repo
放入 /etc/yum.repos.d/
中.
运行:
sudo dnf makecache
## 第3个:TUNA(清华大学软件源)http://mirrors.tuna.tsinghua.edu.cn/help/fedora/
Fedora 镜像使用帮助Fedora 的软件源配置文件可以有多个,其中:系统默认的 fedora
仓库配置文件为 /etc/yum.repos.d/fedora.repo
,系统默认的
updates
仓库配置文件为 /etc/yum.repos.d/fedora-updates.repo
。将上述两个文件先做个备份,分别替换为下面内容,即可使用TUNA 的软件源镜像。
fedora
仓库
(/etc/yum.repos.d/fedora.repo)
[fedora] name=Fedora $releasever - $basearch failovermethod=priority baseurl=https://mirrors.tuna.tsinghua.edu.cn/fedora/releases/$releasever/Everything/$basearch/os/ enabled=1 metadata_expire=28d gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False
updates
仓库
(/etc/yum.repos.d/fedora-updates.repo)
[updates] name=Fedora $releasever - $basearch - Updates failovermethod=priority baseurl=https://mirrors.tuna.tsinghua.edu.cn/fedora/updates/$releasever/$basearch/ enabled=1 gpgcheck=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch skip_if_unavailable=False
更新本地缓存
sudo dnf makecache
## 第4个:FZUG源
注意事项:一些软件依赖 RPM Fusion 源,请事先自行添加。Fedora 24 请添加 RPMFusion-FZUG 源。
1.添加 FZUG 源
# dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repo
或
# dnf install http://repo.fdzh.org/FZUG/free/23/x86_64/fzug-release-23-0.1.noarch.rpm
或
# wget http://repo.fdzh.org/FZUG/FZUG.repo -P /etc/yum.repos.d/
2.安装软件
# dnf install [PackageName]
3.查看软件包列表
$ dnf list --disablerepo=* --enablerepo=fzug-free --enablerepo=fzug-nonfree | grep -i fzug
安装好以上几个源之后,基本够日常使用。
列出所有可用软件:
```
sudo dnf list
```