本站文章总数为:165
Search Posts

2022 centos6 使用阿里云镜像源,测试可用

内容纲要

公司有台老旧centos6,实在是部署了太多服务,我是接手的也不知道里面是不是还有什么不敢重装.但是现在用它yum装什么都不好使了,镜像源挂了,现在网上一堆镜像源不能使用,到阿里云服务器看了下他们的内网镜像源,内网地址mirrors.cloud.aliyuncs.com换成外网地址mirrors.aliyun.com进行使用.

/etc/yum.repos.d下的.repo文件除了CentOS-Base.repo都拷贝走,然后清空 CentOS-Base.repo 内容编辑

查看centos版本 我是6.5

[root@localhost yum.repos.d]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m

可以访问这个地址查看支持的版本号

http://mirrors.aliyun.com/centos-vault/

是6.5 下面的就填写6.5

[base]
name=CentOS-6.5
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

[updates]
name=CentOS-6.5
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

[extras]
name=CentOS-6.5
enabled=1
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

保存 CentOS-Base.repo 后yum clean all && yum makecache

[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d

[root@localhost yum.repos.d]# vim CentOS-Base.repo
[root@localhost yum.repos.d]# yum clean all && yum makecache
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Cleaning repos: base extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Determining fastest mirrors
base | 3.7 kB 00:00
base/group_gz | 220 kB 00:00
base/filelists_db | 5.9 MB 00:00
base/primary_db | 4.4 MB 00:00
base/other_db | 2.8 MB 00:00
extras | 2.9 kB 00:00
extras/filelists_db | 11 kB 00:00
extras/primary_db | 19 kB 00:00
extras/other_db | 6.6 kB 00:00
updates | 2.9 kB 00:00
updates/filelists_db | 4.1 MB 00:00
updates/primary_db | 5.9 MB 00:00
updates/other_db | 838 kB 00:00
Metadata Cache Created

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注