原文鏈接: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源配置完畢!