RedHat,CentOS和Fedora的Yum存储库配置

yum is a tool used to manage rpm packages in distributions like RedHat, CentOS, Fedora, etc. Most know feature of yum is using repositories in order to manage packages download and resolve dependencies. In this tutorial, we will examine the yum repository configuration.

yum是一种工具,用于管理RedHat,CentOS,Fedora等发行版中的rpm软件包。yum的最知名功能是使用存储库来管理软件包的下载并解决依赖性。 在本教程中,我们将检查yum存储库配置。

列出Yum存储库配置 (List Yum Repository Configurations)

yum repositories are stored as files with related configuration. These configuration files are stored in /etc/yum.repos.d/ . We can list currently created repositories with ls command like below.

yum存储库存储为具有相关配置的文件。 这些配置文件存储在/etc/yum.repos.d/ 。 我们可以使用ls命令列出当前创建的存储库,如下所示。

$ ls /etc/yum.repos.d/
List Yum Repository Configurations
List Yum Repository Configurations
列出Yum存储库配置

储存库配置文件(Repository Configuration Files)

Each of these configuration files holds some configuration a single or multiple branches. A single repository may have multiple different branches for different purposes. We can list configuration with cat command like below. We will print the repository fedora.repo .

这些配置文件中的每一个都将某些配置保存为单个或多个分支。 单个存储库可能具有多个不同的分支以实现不同的目的。 我们可以使用cat命令列出配置,如下所示。 我们将打印存储库fedora.repo

$ cat /etc/yum.repos.d/fedora.repo
Look In Detail Repository Configuration
Look In Detail Repository Configuration
详细查看存储库配置

There are different confugration options.

有不同的配置选项。

  • name is the name of the repo

    name是仓库的名称

  • failovermethod used what will be done if there is a problem

    failovermethod使用了如果有问题该怎么办

  • baseurl is the URL to download repository database and information

    baseurl是用于下载存储库数据库和信息的URL

  • metalink is the URL the metadata of the repository

    metalink是存储库元数据的URL

  • enabled specified whether this repository is enabled and usable. We can disable if we do not want to use further.

    enabled指定此存储库是否已启用和可用。 如果我们不想进一步使用,可以将其禁用。

  • metadata_expire specifies how long the downloaded metadata is fresh and useable

    metadata_expire指定所下载的元数据新鲜可用的时间

  • pgpcheck is a security mechanism which checks package is altered or created by the repository owner.

    pgpcheck是一种安全机制,它检查存储库所有者更改或创建的程序包。

  • gpgkey is the GPG key file path

    gpgkey是GPG密钥文件路径

添加新的Yum存储库(Add New Yum Repository)

There are different ways to add a yum repository. We can use yum command to add repository too. We will use localinstall command and provide the rpm URL with --nogpgcheck option like below.

有多种添加yum存储库的方法。 我们也可以使用yum命令添加存储库。 我们将使用localinstall命令并为rpm URL提供--nogpgcheck选项,如下所示。

$ sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rp
Add New Yum Repository 
Add New Yum Repository 
添加新的Yum存储库

顶级外部第三方存储库(Top External Third Party Repositories)

Here we will list 3rd party yum repositories which is very useful.

在这里,我们将列出非常有用的第三方yum存储库。

LEARN MORE  How To List Available Updates and Updateable Packages with Apt, Apt-Get, Aptitude Commands?
了解更多信息如何使用Apt,Apt-Get,Aptitude命令列出可用的更新和可更新的软件包?

翻译自: https://www.poftut.com/yum-repository-configuration-for-redhat-centos-and-fedora/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值