阿里云yum源和tuna源

阿里云开源镜像站地址:阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区阿里巴巴开源镜像站,免费提供Linux镜像下载服务,拥有Ubuntu、CentOS、Deepin、MongoDB、Apache、Maven、Composer等多种开源软件镜像源,此外还提供域名解析DNS、网络授时NTP等服务,致力于为互联网用户提供全面,高效和稳定的基础服务。https://developer.aliyun.com/mirror/

CentOS 镜像地址:

centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站

复制代码
​
CentOS8

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

CentOS6

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

CentOS7

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

​

运行 yum makecache生成缓存

其他 非阿里云ECS用户会出现,Couldn't resolve host 'mirrors.cloud.aliyuncs.com'信息,不影响使用。用户也可以自行修改相关配置:

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

清华大学Centos-yum仓库地址

复制代码
# 对于 CentOS 7
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

# 对于 CentOS 8
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

注意其中的*通配符,如果只需要替换一些文件中的源,请自行增删。

注意,如果需要启用其中一些 repo,需要将其中的 enabled=0 改为 enabled=1

最后,更新软件包缓存

复制代码
sudo yum makecache
相关推荐
草莓熊Lotso22 分钟前
【Linux网络】从0手写Reactor反应堆(二):完善核心细节——ET非阻塞读写、分层架构与回调机制
linux·运维·服务器·网络·c++·tcp/ip·架构
mounter62531 分钟前
深度解析 eBPF LSM:如何利用 eBPF 构建安全的 Linux 内核纵深防御体系
linux·安全·ebpf·linux kernel·kernel
AAA@峥33 分钟前
K8s 配置管理实战:ConfigMap 与 Secret 完整使用指南
kubernetes·云计算
xlq223221 小时前
高并发服务器day21
运维·服务器
Brilliantwxx1 小时前
【Linux】 第一个程序终端进度条
linux·运维·服务器
拂拉氏1 小时前
【知识讲解】 Linux漫漫长路的起始--基础命令的了解
linux·命令
AI创界者1 小时前
【网络安全运维】Kali Linux 下 Medusa(美杜莎)工具的高效部署、故障排查与安全测试实战
linux·运维·web安全
FinelyYang2 小时前
CentOS 7.6 自建 LiveKit 部署指南
linux·运维·centos
Huangjin007_2 小时前
【Linux 系统篇(十四)】进程 (二) :PCB、task_struct、fork系统调用
linux·运维·服务器
HiDev_2 小时前
【非标自动化】硬核阅读理解620行梯形图(70~619行)
运维·自动化