当前位置: 首页 > news >正文

Centos6换源

背景

有些老系统还在使用Centos6 ,偶尔安装个包,找不到源。经测,清华的源仍可用。

换源

  1. 备份
cd/etc/yum.repos.d/mvCentOS-Base.repo CentOS-Base.repo.bak
  1. 更新文件
vim/etc/yum.repos.d/CentOS-Base.repo
[base]name=CentOS-6.10 - Basebaseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/os/$basearch/gpgcheck=1gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-6[updates]name=CentOS-6.10 - Updatesbaseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-6[extras]name=CentOS-6.10 - Extrasbaseurl=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.tuna.tsinghua.edu.cn/centos-vault/RPM-GPG-KEY-CentOS-6

3.更新源

yum clean all yum makecacheLoaded plugins: fastestmirror, product-id, subscription-manager Updating Red Hat repositories. Cleaning repos: base extras updates Cleaning up Everything Cleaning up list of fastest mirrors[root@redhat-201 yum.repos.d]# yum makecacheLoaded plugins: fastestmirror, product-id, subscription-manager Updating Red Hat repositories. Determining fastest mirrors base|3.7kB 00:00 base/group_gz|242kB 00:00 base/filelists_db|6.4MB 00:14 base/primary_db|4.7MB 00:13 base/other_db|2.8MB 00:10 extras|3.4kB 00:00 extras/filelists_db|24kB 00:00 extras/prestodelta|2.2kB 00:00 extras/primary_db|29kB 00:00 extras/other_db|14kB 00:00 updates|3.4kB 00:00 updates/filelists_db|8.4MB 00:08 updates/prestodelta|357kB 00:00 updates/primary_db|12MB 00:12 updates/other_db|479kB 00:01 Metadata Cache Created

4.测试安装

[root@redhat-201 yum.repos.d]# yum install glibc.i686Loaded plugins: fastestmirror, product-id, subscription-manager Updating Red Hat repositories. Setting up Install Process Loading mirror speeds from cached hostfile Resolving Dependencies -->Running transaction check --->Package glibc.i6860:2.12-1.212.el6_10.3 will be installed -->Processing Dependency: glibc-common=2.12-1.212.el6_10.3forpackage: glibc-2.12-1.212.el6_10.3.i686 -->Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3)forpackage: glibc-2.12-1.212.el6_10.3.i686 -->Processing Dependency: libfreebl3.soforpackage: glibc-2.12-1.212.el6_10.3.i686 -->Running transaction check --->Package glibc-common.x86_640:2.12-1.25.el6 will be updated -->Processing Dependency: glibc-common=2.12-1.25.el6forpackage: glibc-2.12-1.25.el6.x86_64 --->Package glibc-common.x86_640:2.12-1.212.el6_10.3 will be an update -->Processing Dependency: tzdata>=2015g-4forpackage: glibc-common-2.12-1.212.el6_10.3.x86_64 --->Package nss-softokn-freebl.x86_640:3.12.9-3.el6 will be updated --->Package nss-softokn-freebl.i6860:3.44.0-6.el6_10 will be installed -->Processing Dependency: nss-util>=3.44.0forpackage: nss-softokn-freebl-3.44.0-6.el6_10.i686 -->Processing Dependency: nspr>=4.21.0forpackage: nss-softokn-freebl-3.44.0-6.el6_10.i686 --->Package nss-softokn-freebl.x86_640:3.44.0-6.el6_10 will be an update -->Running transaction check --->Package glibc.x86_640:2.12-1.25.el6 will be updated -->Processing Dependency: glibc=2.12-1.25.el6forpackage: glibc-headers-2.12-1.25.el6.x86_64 -->Processing Dependency: glibc=2.12-1.25.el6forpackage: glibc-devel-2.12-1.25.el6.x86_64 --->Package glibc.x86_640:2.12-1.212.el6_10.3 will be an update --->Package nspr.x86_640:4.8.7-1.el6 will be updated --->Package nspr.x86_640:4.21.0-1.el6_10 will be an update --->Package nss-util.x86_640:3.12.9-1.el6 will be updated --->Package nss-util.x86_640:3.44.0-1.el6_10 will be an update --->Package tzdata.noarch0:2011g-1.el6 will be updated --->Package tzdata.noarch0:2020d-1.el6 will be an update -->Running transaction check --->Package glibc-devel.x86_640:2.12-1.25.el6 will be updated --->Package glibc-devel.x86_640:2.12-1.212.el6_10.3 will be an update --->Package glibc-headers.x86_640:2.12-1.25.el6 will be updated --->Package glibc-headers.x86_640:2.12-1.212.el6_10.3 will be an update -->Finished Dependency Resolution

阿里云源

  • 以下阿里云的源也可以使用
# 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.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/ http://mirrors.aliyuncs.com/centos-vault/6.10/os/$basearch/ http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/ http://mirrors.tencentyun.com/centos/$releasever/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#released updates[updates]name=CentOS-$releasever- Updates - mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/ http://mirrors.aliyuncs.com/centos-vault/6.10/updates/$basearch/ http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/ http://mirrors.tencentyun.com/centos/$releasever/updates/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-$releasever- Extras - mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/ http://mirrors.aliyuncs.com/centos-vault/6.10/extras/$basearch/ http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/ http://mirrors.tencentyun.com/centos/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever- Plus - mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/ http://mirrors.aliyuncs.com/centos-vault/6.10/centosplus/$basearch/ http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/ http://mirrors.tencentyun.com/centos/$releasever/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-$releasever- Contrib - mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/ http://mirrors.aliyuncs.com/centos-vault/6.10/contrib/$basearch/ http://mirrors.cloud.tencent.com/centos/$releasever/contrib/$basearch/ http://mirrors.tencentyun.com/centos/$releasever/contrib/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
http://www.gsyq.cn/news/1580910.html

相关文章:

  • 2. 石油地球物理测井
  • 大数据偏远院校大数据专业,报考性价比怎么判断
  • 当Windows域客户端寻找LDAP时,Responder如何成为“完美替身“捕获认证凭据
  • Vue2 + ElementUI 批量更新排序/产品分类完整实现
  • windows系统安装Python + Pycharm教程【新手简洁版】
  • 高质量C++/ C编程指南-文件结构
  • 【AI原生思维链工程化白皮书】:2026奇点大会首发CoT落地框架、5大工业级验证范式与3类失效熔断机制
  • 连接第二台手机提示:cannot connect to 192.168.1.130:5555: 由于目标计算机积极拒绝,无法连接。 (10061)
  • 我用手工写标书和AI辅助各做了一周,整理出这份真实对比
  • Java数组深度解析:从基础到架构的实战指南(上)
  • OmniShotCut实战:C++/ONNX部署SOTA镜头检测,一键导出PR时间线(附开源JSX脚本)
  • 自己买共享充电宝到底划不划算
  • 欧盟GMP对AI大模型划定红线,详解药企AI生存法则
  • 高考志愿填报:大数据相关专业到底怎么选?
  • 2026年全铝大门选购指南:哪家工艺更靠谱
  • 用SymPy自动计算抛物线求根、判别式与顶点
  • 一行代码看懂 Linux 内核的时间转换:__month_to_secs 逐行拆解
  • 2026金九银十Java八股文面试题汇总(附答案·全栈覆盖)
  • 多色流式无串扰!647细胞凋亡检测试剂盒
  • 浙大、腾讯团队提出 JAVEdit 相关成果,填补自然语言驱动联合音视频编辑空白
  • 怎样科学评估营销活动真实声量?智能清洗假粉留言的实用指南
  • 幽默,一个 Github 名字叫“马尾辫”,但是他给你省了 80% 的 token
  • 腾讯地图AI功能实测与开发避坑指南
  • MyFramework:异步加载回调为什么要先转移再执行
  • Mistral AI:企业控制 AI 层的新希望,能否在巨头林立的市场突围?
  • Spring AI MCP 工具调用测试文章
  • 奈飞Netflix高级会员解锁版破解版 全网同步 终身免费使用观看
  • 路侧单元被劫持,交叉路口的车全部收到了假信号——V2X路侧安全该怎么做?
  • AI原生状态管理不是框架选择题,而是数学建模题(2026奇点大会论文集第8章精要速读版)
  • AI原生预训练模型选型避坑手册(SITS 2026实测版):5个被厂商隐瞒的关键衰减指标曝光