Openeuler-22.03-LTS-SP4更新yum源

前言

在使用Openeuler的yum源的时候速度很慢,而且因为安全设备的原因有时会将Openeuler系统自带的yum源拦截,所有我们需要更换为第三方源。

一、查看系统版本及架构

#cat /etc/*-release   --查看系统版本
#lscpu                --查看CPU架构

在这里插入图片描述
我用的是X86_64架构的22.03-LTS-SP4版本,根据自己的架构及版本型号来选择源,有些源因为版本没有的。

二、官网查找合适的源

大家根据自己版本选择
Openeuler官网网址链接: link
有些版本列出的源不知道是哪的,我找的是我们熟悉的
有些版本列出的源不知道是哪的,选择全部镜像仓,选择合适的源。我用的aliyun的。
在这里插入图片描述
找到自己需要的版本
在这里插入图片描述

三、更换yum源

1.备份原有yum源

Openeuler的yum源文件在/etc/yum.repos.d/openEuler.repo下

mv /etc/yum.repos.d/openEuler.repo /etc/yum.repos.d/openEuler.repo.bak
rm -rf /etc/yum.repos.d/openEuler.repo

2.新建源文件

vi /etc/yum.repos.d/openEuler.repo

在文件内写入代码(我用的aliyun)

#generic-repos is licensed under the Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
#    http://license.coscl.org.cn/MulanPSL2
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v2 for more details.
 
[OS]
name=OS
baseurl=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/OS/$basearch/RPM-GPG-KEY-openEuler
 
[everything]
name=everything
baseurl=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/everything/$basearch/RPM-GPG-KEY-openEuler
 
[EPOL]
name=EPOL
baseurl=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/EPOL/main/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/OS/$basearch/RPM-GPG-KEY-openEuler
 
[debuginfo]
name=debuginfo
baseurl=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/debuginfo/$basearch/RPM-GPG-KEY-openEuler
 
[source]
name=source
baseurl=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/source/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/source/RPM-GPG-KEY-openEuler
 
[update]
name=update
baseurl=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/update/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/openeuler/openEuler-22.03-LTS-SP4/OS/$basearch/RPM-GPG-KEY-openEuler

3.更新yum源缓存

sudo yum clear all --清除缓存
sudo yum makecache --更新源

四、其他yum源更换

如需更换其他源仅需更换网址即可,
在这里插入图片描述
更换源可用vi编辑器的批量替换,但替换内容中不可出现“/”符号,如:

:%s/old/new/g

在这里插入图片描述
更换后:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值