阿里云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
相关推荐
m0_694845574 分钟前
服务器怎么跑Python项目?
linux·运维·服务器·python·云计算
人机与认知实验室16 分钟前
自动化与智能化
运维·人工智能·自动化
Linux运维技术栈1 小时前
CentOS 7 升级系统内核级库 glibc 2.40 完整教程
linux·运维·centos·glibc·系统内核
刘延林.1 小时前
树莓派5-ollama-linux-arm64.tgz 下载
linux·运维·服务器
拓端研究室1 小时前
专题:2025云计算与AI技术研究趋势报告|附200+份报告PDF、原数据表汇总下载
人工智能·pdf·云计算
半梦半醒*2 小时前
OSPF实验一
运维·网络·网络协议·tcp/ip·网络安全·信息与通信
TeleostNaCl2 小时前
一次因 luci 无法登录而通过 SSH 升级 OpenWrt 固件的经验总结
运维·网络·经验分享·ssh·智能路由器
麟城Lincoln2 小时前
【Linux-云原生-笔记】Apache相关
linux·笔记·云原生·apache·webserver
ZZZKKKRTSAE2 小时前
玩转rhel9 Apache
linux·运维·服务器·apache·web
Z_zz_Z___3 小时前
DNS协议解析过程
linux·服务器·网络