Skip to content

Commit

Permalink
contents(rpmfusion): add sed command and some other fixes
Browse files Browse the repository at this point in the history
- Put RHEL 8/9 before 7/6
- Remove instruction of using su -c 'CMD'
- Add sed command
- Make it clear that it only has Fedora example
- 请参考 -> 可参考
  • Loading branch information
taoky committed Jun 18, 2024
1 parent dba1d7d commit 41df257
Showing 1 changed file with 27 additions and 20 deletions.
47 changes: 27 additions & 20 deletions contents/rpmfusion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ cname: 'rpmfusion'
{
title: '发行版',
items: [
['CentOS/RHEL 7', { version: '7' }],
['CentOS/RHEL 6', { version: '6' }],
['CentOS/RHEL 8', { version: '8' }],
['CentOS/RHEL 9', { version: '9' }],
['CentOS/RHEL 7', { version: '7' }],
['CentOS/RHEL 6', { version: '6' }],
]
},
]}
Expand All @@ -47,54 +47,61 @@ cname: 'rpmfusion'

</CodeBlock>

注意:没有将当前用户设为管理员的用户,需要将 `sudo CMD` 替换为 `su -c 'CMD'`,并输入 root 密码。

### 修改链接指向镜像站

安装成功后,修改 `/etc/yum.repos.d/` 目录下以 `rpmfusion` 开头,以 `.repo` 结尾的文件。具体而言,需要将文件中的 `baseurl=` 开头的行等号后面链接中的 `http://download1.rpmfusion.org/` 替换为
安装成功后,使用以下命令修改 `/etc/yum.repos.d/` 目录下以 `rpmfusion` 开头,以 `.repo` 结尾的文件

<CodeBlock>

```
{{http_protocol}}{{mirror}}/
```shell
{{sudo}}sed -e 's!^metalink=!#metalink=!g' \
-e 's!^mirrorlist=!#mirrorlist=!g' \
-e 's!^#baseurl=!baseurl=!g' \
-e 's!https\?://download1\.rpmfusion\.org/!{{http_protocol}}{{mirror}}/!g' \
-i.bak /etc/yum.repos.d/rpmfusion*.repo
```

</CodeBlock>

替换后的文件类似如下:
以 Fedora 下的 `/etc/yum.repos.d/rpmfusion-free.repo` 为例,替换后的文件类似如下:

<CodeBlock>

```ini
[rpmfusion-free]
name=RPM Fusion for Fedora $releasever - Free
baseurl={{http_protocol}}{{mirror}}/free/fedora/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch
baseurl=https://mirrors.ustc.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/os/
#metalink=https://mirrors.rpmfusion.org/metalink?repo=free-fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
metadata_expire=14d
type=rpm-md
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch
repo_gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever

[rpmfusion-free-debuginfo]
name=RPM Fusion for Fedora $releasever - Free - Debug
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-debug-$releasever&arch=$basearch
baseurl=https://mirrors.ustc.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/debug/
#metalink=https://mirrors.rpmfusion.org/metalink?repo=free-fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
type=rpm-md
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch
repo_gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever

[rpmfusion-free-source]
name=RPM Fusion for Fedora $releasever - Free - Source
baseurl={{http_protocol}}{{mirror}}/free/fedora/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-source-$releasever&arch=$basearch
baseurl=https://mirrors.ustc.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/source/SRPMS/
#metalink=https://mirrors.rpmfusion.org/metalink?repo=free-fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
type=rpm-md
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch
repo_gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever
```

</CodeBlock>

### 更多

RHEL/CentOS 用户请参考 [RPMFusion 官方指南](http://rpmfusion.org/Configuration)
RHEL/CentOS 用户可参考 [RPMFusion 官方指南](http://rpmfusion.org/Configuration)

0 comments on commit 41df257

Please sign in to comment.