news 2026/5/19 22:07:52

Centos9更换阿里源

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Centos9更换阿里源

1.centos9换成国内阿里源使其下载软件较快。

先查看cnetos9本身的源

cat /etc/yum.repos.d/centos.repo

2.备份系统本身的源

[root@localhost ~]# mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.backup

3.然后编辑阿里源进去在/etc/yum.repos.d/centos.repo

[root@localhost ~]# vi /etc/yum.repos.d/centos.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/
gpgcheck=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official

#additional packages that may be useful
#[extras]
#name=CentOS-$releasever - Extras - mirrors.aliyun.com
#failovermethod=priority
#baseurl=https://mirrors.aliyun.com/centos-stream/$stream/extras/$basearch/os/
# http://mirrors.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/
# http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/
#gpgcheck=0
#gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/centosplus/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/
gpgcheck=0
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=CentOS-$releasever - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/PowerTools/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/
gpgcheck=0
enabled=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official


[AppStream]
name=CentOS-$releasever - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/os/
http://mirrors.aliyuncs.com/centos-stream/$stream/AppStream/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/AppStream/$basearch/os/
gpgcheck=0
gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official

把这个复制进去然后按wq保存退出。

4.安装阿里提供的epel软件包

yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-9.noarch.rpm

清空缓存

yum makecache

然后在更新软件

yum update

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/5/19 22:02:39

ABB伺服驱动抱闸功能详解:从参数设置到点动测试的保姆级指南

ABB伺服驱动抱闸功能深度解析:从物理原理到工程验证的全链路实践 在工业自动化领域,伺服驱动的抱闸功能如同汽车的手刹系统,是保障设备安全运行的最后一重防线。当生产线突然断电、机械臂需要精准悬停或是垂直负载必须防止自由落体时&#xf…

作者头像 李华
网站建设 2026/5/19 21:54:06

Godot-MCP完整指南:如何用AI助手3倍提升游戏开发效率

Godot-MCP完整指南:如何用AI助手3倍提升游戏开发效率 【免费下载链接】Godot-MCP An MCP for Godot that lets you create and edit games in the Godot game engine with tools like Claude 项目地址: https://gitcode.com/gh_mirrors/god/Godot-MCP Godot-…

作者头像 李华
网站建设 2026/5/19 21:49:14

AD9834 DDS信号源模块PCB设计避坑指南:从原理图到打样的完整流程

AD9834 DDS信号源模块PCB设计避坑指南:从原理图到打样的完整流程 在电子设计领域,直接数字频率合成(DDS)技术因其高精度和灵活性而广受欢迎。AD9834作为一款性价比较高的DDS芯片,常被用于信号源发生器的设计中。然而&a…

作者头像 李华
网站建设 2026/5/19 21:48:33

Keil5玩转STM32内存:除了Flash,你的程序还能在RAM里“飞”起来

Keil5玩转STM32内存:除了Flash,你的程序还能在RAM里“飞”起来 当大多数STM32开发者还在习惯性地将程序烧录到Flash时,一些追求极致的工程师已经开始探索更灵活的内存部署方案。想象一下,你的代码在RAM中运行时的启动速度能比Flas…

作者头像 李华
网站建设 2026/5/19 21:48:12

蚂蚁百宝箱MCP实战:6步构建Qwen3智能体,3分钟发布支付宝小程序

前言 2026年5月,蚂蚁百宝箱(Tbox)完成重磅升级,原生支持MCP(模型上下文协议) 并全量接入通义千问Qwen3全系列模型,同时推出一键发布支付宝小程序功能。这意味着开发者无需编写一行代码&#xff…

作者头像 李华