Skip to content

Commit

Permalink
rpmfusion: Apply PR #239
Browse files Browse the repository at this point in the history
The original author does not respond to modification request for months.

Closes #239.

Co-authored-by: DavidDengHui <[email protected]>
  • Loading branch information
taoky and DavidDengHui committed Apr 20, 2024
1 parent a0aef26 commit 26969be
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions docs/rpmfusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,45 @@ RPM Fusion 是为 Fedora/RHEL 提供额外 RPM 软件包的第三方软件源。

## 使用说明

使用下列命令(在 bash 或兼容 shell 中),可以同时启用其 **free**
**nonfree** 软件源:
使用下列命令(在 bash 或兼容 shell 中),可以同时启用其 **free****nonfree** 软件源:

- Fedora 22 及更高版本:

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

- RHEL 6 或兼容系统(如 CentOS):
- RHEL 7 或兼容系统(如 CentOS):

```shell
sudo yum localinstall --nogpgcheck https://mirrors.ustc.edu.cn/rpmfusion/free/el/rpmfusion-free-release-6.noarch.rpm https://mirrors.ustc.edu.cn/rpmfusion/nonfree/el/rpmfusion-nonfree-release-6.noarch.rpm
sudo yum localinstall --nogpgcheck https://mirrors.ustc.edu.cn/rpmfusion/free/el/rpmfusion-free-release-7.noarch.rpm https://mirrors.ustc.edu.cn/rpmfusion/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
```

- RHEL 7 或兼容系统(如 CentOS):
如果 `sudo` 不可用,你可以把以上命令中的 `sudo` 替换成 `su -c`

## 替换源地址

安装成功后,可使用下列命令备份并修改 `/etc/yum.repos.d/` 目录下以 `rpmfusion` 开头,以 `.repo` 结尾的文件。

- 具体而言,需要将文件中 `metalink=` 开头的行注释掉,取消 `baseurl=` 开头的行的注释并将等号后面链接中的 `http://download1.rpmfusion.org` 替换为 `https://mirrors.ustc.edu.cn/rpmfusion`

```shell
sudo yum localinstall --nogpgcheck https://mirrors.ustc.edu.cn/rpmfusion/free/el/rpmfusion-free-release-7.noarch.rpm https://mirrors.ustc.edu.cn/rpmfusion/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
sudo sed -e 's|^metalink=|#metalink=|g' \
-e 's|^#baseurl=http://download1.rpmfusion.org|baseurl=https://mirrors.ustc.edu.cn/rpmfusion|g' \
-i.bak \
/etc/yum.repos.d/rpmfusion*.repo
```

如果 `sudo` 不可用,你可以把以上命令中的 `sudo` 替换成 `su -c`
- 修改完成后,清除并重建缓存:

```shell
sudo dnf clean all
sudo dnf makecache
```

## 备注

在 RHEL 或兼容发行版(如 CentOS)上,您需要先启用 EPEL 源,请参考
`epel`
在 RHEL 或兼容发行版(如 CentOS)上,您需要先启用 EPEL 源,请参考 [epel](epel.md)。

## 相关链接

Expand Down

0 comments on commit 26969be

Please sign in to comment.