为了下载速度快,每次都要做好镜像的更改,既然次数多,懒得每次还来查资料,就自己写一篇博客加强自己的记忆。
阿里巴巴 OPSX 开源镜像站,提供 CentOS、Debian、Ubuntu、 Fedora、Arch Linux、Gentoo、openSUSE、Scientific Linux 等主流发行版的软件源镜像。为阿里云和互联网用户提供免费高速的一站式镜像服务
镜像站官网:阿里巴巴镜像站链接
参考链接:CentOS镜像
CentOS,是基于 Red Hat Linux 提供的可自由使用源代码的企业级 Linux 发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。
镜像下载地址:
https://mirrors.aliyun.com/centos/
https://mirrors.aliyun.com/centos-vault/
1、备份自带的YUM源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下载新的yum源
CentOS 7版本:
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
3、清除旧的 yum 缓存
[root@nfs ~]# yum clean all
已加载插件:fastestmirror
正在清理软件源: base extras updates
Cleaning up list of fastest mirrors
4、更新yum缓存
yum makecache
[root@nfs ~]# yum makecache
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
base/7/x86_64/primary_db FAILED ] 0.0 B/s | 37 kB --:--:-- ETA
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
正在尝试其它镜像。
(1/10): base/7/x86_64/group_gz | 153 kB 00:00:01
(2/10): extras/7/x86_64/other_db | 149 kB 00:00:01
(3/10): extras/7/x86_64/filelists_db | 276 kB 00:00:03
base/7/x86_64/filelists_db FAILED ] 235 kB/s | 5.1 MB 00:03:11 ETA
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/d6d94c7d406fe7ad4902a97104b39a0d8299451832a97f31d71653ba982c955b-filelists.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
extras/7/x86_64/primary_db FAILED ] 243 kB/s | 5.3 MB 00:03:04 ETA
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/511a574b4c3f907f9acfe5603566958fb6f09137292c5cd5d5d57c298864790f-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
(4/10): base/7/x86_64/other_db | 2.6 MB 00:00:22
updates/7/x86_64/primary_db FAILED ] 320 kB/s | 6.4 MB 00:02:16 ETA
http://mirrors.aliyuncs.com/centos/7/updates/x86_64/repodata/bc8950506fb13622afd9eb93c811884b6e2e7570afd5fac946f708ac01ae0cff-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
正在尝试其它镜像。
(5/10): extras/7/x86_64/primary_db | 249 kB 00:00:02
(6/10): updates/7/x86_64/other_db | 1.3 MB 00:00:12
(7/10): base/7/x86_64/primary_db | 6.1 MB 00:00:53
(8/10): base/7/x86_64/filelists_db | 7.2 MB 00:01:02
(9/10): updates/7/x86_64/filelists_db | 11 MB 00:01:36
(10/10): updates/7/x86_64/primary_db | 20 MB 00:02:59
元数据缓存已建立
放点耐心,稍等几分钟~
文章来源:https://www.toymoban.com/news/detail-744072.html
4、查看更换的阿里云镜像的仓库是否生效。
yum repolist
[root@nfs ~]# yum repolist
已加载插件:fastestmirror
Determining fastest mirrors
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/4): base/7/x86_64/group_gz | 153 kB 00:00:01
(2/4): extras/7/x86_64/primary_db | 249 kB 00:00:02
(3/4): base/7/x86_64/primary_db | 6.1 MB 00:00:51
(4/4): updates/7/x86_64/primary_db | 20 MB 00:02:58
源标识 源名称 状态
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 515
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 4,839
repolist: 15,426
[root@nfs ~]#
更换阿里云镜像站——CentOS镜像生效。文章来源地址https://www.toymoban.com/news/detail-744072.html
到了这里,关于【阿里云镜像】更改阿里巴巴开源镜像站镜像源之——CentOS 7的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!