# 设置主机名
hostnamectl set-hostname lfy
# 查看主机名
hostname
# 配置aliyun-yum源
# 1、先备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 2、下载文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 3、清理缓冲
yum makecache
# 配置aliyun-yum-扩展源
# 1、先备份
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
# 2、下载文件
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 3、清理缓冲
yum makecache
yum网络源阿里云-刚更新的-脚本
最新推荐文章于 2025-09-18 14:46:25 发布
本文介绍如何在 CentOS 系统中更改默认的 YUM 源为阿里云提供的高速镜像站点。首先指导读者设置主机名,并详细解释了备份原始配置文件、下载新的配置文件及清理缓存的具体步骤。
1369

被折叠的 条评论
为什么被折叠?



