一分钟学会RHEL8 YUM源下载及应用

一、红帽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编辑器打开软件源

[[email protected] ~]# 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

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

[[email protected] ~]# dnf clean all

[[email protected] ~]# dnf makecache

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