RHEL8安装epel源

13 篇文章 2 订阅

RedHat8服务器安装的基本配置

参考地址: https://developer.aliyun.com/mirror/centos
epel参考地址: https://developer.aliyun.com/mirror/epel

配置扩展源参考: https://blog.csdn.net/omaidb/article/details/120393850


配置主机名

# 显示默认主机名
hostname

# 永久修改主机名
hostnamectl set-hostname 主机名

关闭防火墙

# 显示当前防火墙状态
firewall-cmd --state

# 关闭防火墙服务
systemctl stop firewalld.service

# 关闭防火墙开机自启服务
systemctl disable --now firewalld.service

关闭SELinux

# 查看SELinux启动状态
sestatus

# 临时关闭SELinux
setenforce 0

# 永久关闭SELinux
# 修改SELinux的配置为disabled
vi /etc/selinux/config
## 将SELINUX=enforcing改为SELINUX=disabled

# 关闭SELinux
setenforce 0

# 查看当前运行模式
getenforce

配置yum仓库


RHEL8配置BaseOS源

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
# 如果没有wget, 则使用curl下载
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo

RHEL8安装epel源


安装epel-release包
# 安装epel官方源
yum install epel-release -y
yum -y install https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm

备份原有的elep.repo文件
# 新建yumbak目录
mkdir -p /etc/yum.repos.d/yumbak

# 将所有的epel*开头的repo文件移动到yumbak目录
mv epel* yumbak

手动创建epel.repo文件–仅适用于RHEL8

/etc/yum.repos.d/目录下新建epel.repo,将下列内容粘贴到epel.repo文件中

# 中科大的epel源---建议
[epel-USTC]
name=epel-USTC--CentOS-$releasever
baseurl=https://mirrors.ustc.edu.cn/epel/$releasever/Everything/$basearch/
enabled=1
gpgcheck=0


# 华为云的epel源
[epel-huaweicloud]
name=epel-huaweicloud-CentOS-$releasever
baseurl=https://mirrors.huaweicloud.com/epel/$releasever/Everything/$basearch/
gpgcheck=0


# 清华的epel源
[epel-tsinghua]
name=Extra Packages-tsinghua for Enterprise Linux $releasever - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
enabled=1
gpgcheck=1
countme=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

刷新源
# 快速生成缓存
sudo yum makecache fast

# 生成完整缓存
sudo yum clean all && sudo yum makecache

从epel源安装软件

epel源中有许多高质量的扩展软件,例如: htop,ncdu,nginx,vnstat

# 安装htop
yum install htop -y

RHEL8使用Centos源更新软件包—更新软件包但不更新内核

# 若更新 yum 源不更新内核,在 yum 的命令后面加上如下的参数
yum --exclude=kernel* update
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

识途老码

赞赏是第一生产力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值