Centos7安装ELRepo源

安装ELRepo源

用来更新内核,Centos7的内核默认只到3.10,这个源可以更新到最新的内核.例如5.4

参考: https://elrepo.org/tiki/HomePage


Centos7安装ELRepo源

# yum仓库中安装ELRepo源
yum install elrepo-release -y

# 从ELRepo官网安装epelrepo源
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

# 导入gpg key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

快速添加ELRepo源(国内)
# 安装yum-config-manager
yum install -y yum-utils

# 添加elrepo/elrepo源
yum-config-manager --add-repo=https://mirrors.tuna.tsinghua.edu.cn/elrepo/elrepo/el7/x86_64/

# 添加elrepo/kernel源
yum-config-manager --add-repo=https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/

# 添加elrepo/extras/源
https://mirrors.tuna.tsinghua.edu.cn/elrepo/extras/el7/x86_64/

# 查看添加的项目
yum repolist

elrepo.repo配置内容如下

适用于Centos7.

[elrepo-elrepo]
name=added from: https://mirrors.tuna.tsinghua.edu.cn/elrepo/elrepo/el7/x86_64/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/elrepo/elrepo/el7/x86_64/
enabled=1
gpgcheck=0

[elrepo-extras]
name=added from: https://mirrors.tuna.tsinghua.edu.cn/elrepo/extras/el7/x86_64/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/elrepo/extras/el7/x86_64/
enabled=1
gpgcheck=0

[elrepo-kernel]
name=added from: https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/
baseurl=https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el7/x86_64/
enabled=1
gpgcheck=0

测试安装包

# bash-completion-extras需要依赖elrepo-extras源
yum install -y bash-completion-extras

rhel8安装epelrepo源

# rhel8安装epelrepo源
rpm -Uvh https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

# 导入gpg key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

替换为国内源

参考: https://mirrors.tuna.tsinghua.edu.cn/help/elrepo/
替换为ELRepo清华源 https://notion.ccm.ink/centos-core

# 替换为清华源
cd /etc/yum.repos.d

# 备份
cp elrepo.repo elrepo.repo.bak

# 将elrepo.org/linux替换为mirrors.tuna.tsinghua.edu.cn/elrepo
# 替换为清华 ELRepo 源
$ sed -e "s|mirrorlist=|#mirrorlist=|g" \
      -e "s|elrepo.org/linux|mirrors.tuna.tsinghua.edu.cn/elrepo|g"\
      -i.bak \
      /etc/yum.repos.d/elrepo.repo
## 安装完成后检查 /boot/grub2/grub.cfg 中对应内核 menuetry 中是否包含 initrd16 配置,如果没有,再安装一次

刷新缓存

# 刷新缓存
yum repolist && yum clean all && yum makecache

安装4.4以上版本内核

https://blog.csdn.net/omaidb/article/details/121856924

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

识途老码

赞赏是第一生产力

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

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

打赏作者

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

抵扣说明:

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

余额充值