如何在 Fedora 中添加第三方存储库以访问大量附加软件
存储库 Fedora
![](/data/attachment/album/202012/08/074323tkjpr2499rtjnjq0.jpg)


在你安装 Fedora 后。你可能会发现你想要安装和使用的一些软件在软件商店中找不到。出于一些原因，这些软件包不能出现在 Fedora 存储库中。


不用担心，我将告诉你如何为 Fedora 添加第三方存储库来使这些软件包可使用。


### 在 Fedora 中的第三方存储库是什么？


操作系统开发人员通常会决定哪些软件包可以在其存储库中使用，哪些软件包不可以在其存储库中使用。Fedora 也是如此。依据 [Fedora 文档](https://docs.fedoraproject.org/en-US/quick-docs/setup_rpmfusion/#third-party-repositories) ，第三方存储库包含有 “拥有更为宽松的许可政策，并提供 Fedora 因各种原因所排除软件包” 的软件包。


Fedora 强制执行下面的 [准则](https://fedoraproject.org/wiki/Forbidden_items) ，当它打包软件包时:


* 如果它是专有的，它就不能包含在 Fedora 中
* 如果它在法律上被限制，它就不能包含在 Fedora 中
* 如果它违反美国法律（特别是联邦政府或适用于州政府的法律），它就不能包含在 Fedora 中


因此，有一些可以由用户自行添加的存储库。这使得用户能够访问附加的软件包。


### 在 Fedora 中启用 RPM Fusion 存储库


[RPM Fusion](https://rpmfusion.org/RPM%20Fusion) 是 Fedora 的第三方应用程序的主要来源。RPM Fusion 是由三个项目（Dribble、Freshrpms 和 Livna）合并而成的。RPM Fusion 提供两种不同的软件存储库。


* free 存储库：包含开源软件。
* nonfree 存储库：包含没有开源协议的软件，但是它们的源文件代码却是可以自由使用的。


这里有两种方法来启动 RPM Fusion：从终端启用，或通过点击几个按钮来启用。我们将逐一查看。


#### 方法 1：命令行方法


这是启用 RPM Fusion 存储库的最简单的方法。只需要输入下面的命令即可启用两个存储库：



```
sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

```

会要求你输入密码、确认是否你想要安装这些存储库。在你确认后，安装过程将在几秒钟或几分钟内完成。


![通过命令行安装 RPM Fusion](/data/attachment/album/202012/08/074421at4wec4wzcijeet0.png)


#### 方法 2：图形用户界面方法


使用这个方法来启用 RPM Fusion 存储库，你需要访问 [RPM Fusion 网站](https://rpmfusion.org/Configuration) 。你将看到针对不同 Fedora 版本的两个存储库的链接。


RPM Fusion 建议先安装 free 存储库。因此，单击针对你 Fedora 版本的 free 存储库的链接。然后会打开一个窗口来询问你是否想安装该存储库。单击安装。


![通过图形用户界面安装 RPM Fusion](/data/attachment/album/202012/08/074452qli72bbl7byxbqyt.png)


在安装过程完成后，返回并使用相同的步骤安装 nonfree 存储库。


### 启用 Fedora 的第三方存储库


Fedora 最近开始提供它自己的 [第三方应用程序存储库](https://fedoraproject.org/wiki/Workstation/Third_Party_Software_Repositories) 。在这个存储库中 [可使用的应用程序的数量](https://fedoraproject.org/wiki/Workstation/Third_party_software_list) 是非常少的。你可以 [使用它来在 Fedora 上安装 Chrome 浏览器](https://itsfoss.com/install-google-chrome-fedora/) 。除 Chrome 外，它也包含 Adobe Brackets、Atom、Steam、Vivaldi、Opera 等应用程序。


就像 RPM Fusion 一样，你可以通过终端或图形用户界面的方法来启用这个存储库。


#### 方法 1：命令行方法


为启用 Fedora 的第三方存储库，输入下面的命令到你的终端中：



```
sudo dnf install fedora-workstation-repositories

```

当被提示时，确保输入你的密码并输入 `Y` 来确认安装。


#### 方法 2：图形用户界面方法


如果你不习惯使用终端，你可以使用图形用户界面方法。


首先，你需要打开 Gnome “软件”。接下来，你需要单击右上角的汉堡菜单，并从菜单中选择“软件存储库”。


![Gnome 软件的菜单](/data/attachment/album/202012/08/074432d0b5tb8uxkputtu5.png)


在软件存储库窗口中，你将在其顶部看到写着 “第三方存储库” 字样的部分。单击“安装”按钮。当你被提示时，输入你的密码。


![Fedora 第三方存储库安装](/data/attachment/album/202012/08/074436omnddprda8ncxlal.png)


随着这些附加存储库的启用，你可以安装软件到你的系统当中。你可以从软件中心管理器或使用 DNF 软件包管理器来轻松地安装它们。


如果你发现这篇文章很有趣，请花费一些时间来在社交媒体上分享它。




---


via: <https://itsfoss.com/fedora-third-party-repos/>


作者：[John Paul](https://itsfoss.com/author/john/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[robsean](https://github.com/robsean) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

After you install Fedora, you may discover that some of the [popular Linux softwar](https://itsfoss.com/essential-linux-applications/)e that you want to install are not available in the software store.

This is because Fedora enforces the following [guidelines](https://fedoraproject.org/wiki/Forbidden_items?ref=itsfoss.com) when it comes to packages:

- If it is proprietary, it cannot be included in Fedora
- If it is legally encumbered, it cannot be included in Fedora
- If it violates United States laws (specifically, Federal or applicable state laws), it cannot be included in Fedora

Don’t lose hope. You can make the additional applications available by adding third party repos for Fedora.

## Third party repositories in Fedora

There are two main third-party repositories in Fedora:

- Fedora’s own third party repositories: Fedora provides an easy way of enabling a third-party repository and accessing a few popular software like Chrome, Steam, Nvidia drivers.
- RPM Fusion repositories: This third-party repository gives you access to a huge number of Linux applications that are not provided from Fedora’s own repositories.

Let’s see how to enable these third party repositories in Fedora.

## Part 1: Enabling RPM Fusion Repositories in Fedora

[RPM Fusion](https://rpmfusion.org/RPM%20Fusion?ref=itsfoss.com) is the main source for third party applications for Fedora. RPM Fusion is the result of three projects (Dribble, Freshrpms, and Livna) merging. RPM Fusion offers two different software repos.

- The free repo contains open-source software.
- The nonfree repo contains software that does not have an open-source license, but the source code is freely available.

There are two ways to enable RPM Fusion: from the terminal or by clicking a couple of buttons. We’ll take a look at each.

### Method 1: Command line method

This is the easiest method to enable the RPM Fusion repos.

Just enter the following command to enable the RPM Fusion repository for open source software:

`sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm `


For non-free (i.e. not open source) software, add this repository.

`sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm`


You will be asked to enter your password. You will then be asked to verify that you want to install these repos. Once you approve it, the installation will be completed in a few seconds or minutes.

![Install RPM Fusion via command line](https://itsfoss.com/content/images/wordpress/2020/11/install-rpmfusion-cli-800x604.png)

Optionally, you may also use the command below to show the packages from RPM Fusion repository in the GNOME Software Center.

`sudo dnf groupupdate core`


### Method 2: Graphical method

To enable the RPM Fusion repos using this method, you need to visit the [RPM Fusion Website](https://rpmfusion.org/Configuration?ref=itsfoss.com). You will see links for both repos for different Fedora versions.

![rpm fusion graphical](https://itsfoss.com/content/images/wordpress/2021/07/rpm-fusion-graphical.png)

RPM Fusion recommends installing the free repo first. So, click the link for the free repo for your version of Fedora.

This will download the RPM file for the repo. [Installing RPM file](https://itsfoss.com/install-rpm-files-fedora/) is really easy. Just double-click on it and it will be opened in the Software Center application. Now, just hit the Install button.

![Install RPM Fusion via GUI](https://itsfoss.com/content/images/wordpress/2020/11/install-rpmfusion-gui-800x582.png)

Once the installation is completed, go back and install the nonfree repo using the same steps.

**To get the RPM Fusion packages in the software center**, you’ll have to add the appstream metadata using the terminal:

`sudo dnf groupupdate core`


## Part 2: Enable Fedora’s Third Party repositories

Fedora recently started offering its own [repo of third party apps](https://fedoraproject.org/wiki/Workstation/Third_Party_Software_Repositories?ref=itsfoss.com). The [number of applications available](https://fedoraproject.org/wiki/Workstation/Third_party_software_list?ref=itsfoss.com) in this repo is very small. You can [install Chrome browser on Fedora with it](https://itsfoss.com/install-google-chrome-fedora/). Apart from Chrome, it also includes tools like Adobe Brackets, Atom, Steam, Vivaldi, Opera, and more.

Just like RPM Fusion, you can enable this repo via the terminal or graphically.

### Method 1: Command line method

To enable Fedora’s third-party repo, enter the following command into your terminal:

`sudo dnf install fedora-workstation-repositories`


Be sure to ensure your password when prompted and type Y to approve the installation.

### Method 2: Graphical method

If you are not comfortable using the terminal, you can use the graphical method.

First, you need to open Gnome Software. Next, you need to click on the hamburger menu in the top right corner and select “Software Repositories” from the menu.

![Enabling third-party repositories in Fedora](https://itsfoss.com/content/images/wordpress/2021/07/enable-third-party-repo-in-fedora-800x368.png)

In the Software Repositories window, you will see a section at the top that says “Third Party Repositories”. Click the Install button. Enter your password when you are prompted and you are done.

![Enabling third-party repositories in Fedora](https://itsfoss.com/content/images/wordpress/2021/07/enabling-third-party-repo-in-fedora-800x394.png)

You can see some additional software sources now like Google Chrome, Nvidia etc. To install those applications, you have to enable these ‘sub repositories’.

![Enable sub repositories to install Chrome, Nvidia drivers and some other third party applications in Fedora](https://itsfoss.com/content/images/wordpress/2021/07/third-party-repositories-installed-in-fedora-800x445.png)

With these additional repositories enabled, you can install software to your heart’s content. You can easily install them from the software center or use the DNF package manager.

If you found this article interesting, please take a minute to share it on social media, Hacker News, or [Re](https://%0Areddit.com/r/linuxusersgroup)[d](https://%0Areddit.com/r/linuxusersgroup)[dit](https://%0Areddit.com/r/linuxusersgroup).