Cat-God-007

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

Yum工具详解(三)----- Yum配置阿里源CentOS 6.x

一:背景

yum源破损,无法下载软件,也无法查看yum库里的包;可能是机器所需的版本比较老。

二:解决思路

由于 CentOS 6.X 阿里云已经停止维护更新,国内所有的镜像源、 yum 源已经更新地址,使用阿里云:http://mirrors.aliyun.com/centos-vault/ 寻找对应自己系统版本。现在阿里云centos6都默认更新为Centos6.10版本。找到原来的源(配置文件),进行替换。

三:解决步骤

  1. /etc/yum.repos.d下的源(所有源)重名命
mkdir /root/opt
mv /etc/yum.repos.d/*  /root/opt/
  1. 创建Centos6的源
vi  /etc/yum.repos.d/CentOS-Base.repo
  1. 编辑内容
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
  1. 清除原来的源
yum clean all
  1. 编译阿里源
yum makecache
  1. 查看yum库里的包
yum list

到这里,换源就基本上成功了!

在这里插入图片描述
感谢大家的支持,关注,评论,点赞!

posted on   成果和地方  阅读(118)  评论(0编辑  收藏  举报  

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
点击右上角即可分享
微信分享提示