RedHat 8 dnf源配置

原文链接:https://weibo.com/ttarticle/p/show?id=2309404343983441610394

一、红帽8概述

1、红帽8发布

    2018年下半年RedHat公司发布了其下一代操作系统Red Hat Enterprise Linux 8 Beta (简称为RHEL8)版本。

2、红帽8主要变化

此版本在功能及新特性方面都有了大幅度的提升,主要变化体现在:

① 基于 Fedora 28 和 kernel 4.18

② 包管理系统 yum 基于 dnf,支持模块内容流

③ 默认 Python 3.6,有限支持 Python 2.7,PHP 7.2,PERL 5.26,Ruby 2.5,Apache 2.4.35 和 NGINX 1.4

④ GNOME 3.28 桌面默认使用 Wayland,停止支持 KDE

⑤ nftables 取代 iptables

⑥ MySQL 8.0,MariaDB 10.3,PostgreSQL 10 和 9.6,Redis 4.0,因许可证变更不包含 MongoDB,等等

二、红帽8中yum源配置

1、yum源变化说明

本文将带大家了解一下RHEL8的yum源配置。

    RHEL8中默认使用的软件批量管理工具由原版本的yum换成了速度更快的dnf,原有的yum命令仅为dnf的软链接,当然依旧可以使用的。

    dnf源文件所在目录依旧为/etc/yum.repos.d/下,但官方在发布Beta版本时并没有为此系统自带源文件,需要我们自行下载,我们将使用清华源提供的源文件来为RHEL8系统提供软件安装源。

2、dnf源文件下载

首先,需要访问清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/

打开后,在搜索框,搜索redhat关键词,如下图所示:

搜索成功后,进入redhat目录,找到rhel目录,如下图所示:

找到rhel-8-beta目录,如下图所示:

下载rhel-8-beta.repo文件,如下图所示:

3、dnf源配置

主机下载完RHEL8软件源后,需要在红帽8主机中进行如下配置:

① 使用vim编辑器打开软件源

[root@localhost  ~]# vim /etc/yum.repos.d/rhel-8-beta.repo

② 具体配置如下:

[rhel-8-baseos-beta-source-rpms]

name = Red Hat Enterprise Linux 8 - BaseOS Beta (Source RPMs)

baseurl = https://downloads.redhat.com/redhat/rhel/rhel-8-beta/baseos/source/

enabled = 1

gpgcheck = 1

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-8-for-x86_64-baseos-beta-rpms]

name = Red Hat Enterprise Linux 8 for x86_64 - BaseOS Beta (RPMs)

baseurl = https://downloads.redhat.com/redhat/rhel/rhel-8-beta/baseos/x86_64/

enabled = 1

gpgcheck = 1

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-8-appstream-beta-source-rpms]

name = Red Hat Enterprise Linux 8 - AppStream Beta (Source RPMs)

baseurl = https://downloads.redhat.com/redhat/rhel/rhel-8-beta/appstream/source/

enabled = 1

gpgcheck = 1

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-8-for-x86_64-appstream-beta-rpms]

name = Red Hat Enterprise Linux 8 for x86_64 - AppStream Beta (RPMs)

baseurl = https://downloads.redhat.com/redhat/rhel/rhel-8-beta/appstream/x86_64/

enabled = 1

gpgcheck = 1

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

其实只是将enabled = 0 修改为 enabled = 1 可使用命令:sed -i 's/enabled = 0/enabled = 1/g'  rhel-8-beta.repo

修改完成后,进行元数据缓存后即可使用。

[root@localhost ~]# dnf clean all

[root@localhost ~]# dnf makecache

到此,红帽8中的dfn源配置完毕!

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值