当前位置:   article > 正文

centos7配置阿里云的镜像站点作为软件包下载源_阿里云镜像站 centos7

阿里云镜像站 centos7

目录

1、备份

2、下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

3、测试


阿里镜像提供的配置方法:centos镜像_centos下载地址_centos安装教程-阿里巴巴开源镜像站

1、备份

[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载新的 CentOS-Base.repo 到 /etc/yum.repos.d/

出现错误的原因:我在配置静态IP时,没有配置DNS服务器地址,导致本地无法将域名解析成IP地址,从而导致无法连接上阿里云服务器的镜像仓库。

重启网卡,使得修改的配置文件信息生效。重新下载,发现此时能成功下载了。

3、测试

  1. [root@localhost ~]# yum install httpd -y
  2. Loaded plugins: fastestmirror
  3. Loading mirror speeds from cached hostfile
  4. * base: mirrors.aliyun.com
  5. * extras: mirrors.aliyun.com
  6. * updates: mirrors.aliyun.com
  7. http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
  8. Trying other mirror.
  9. http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Unknown error"
  10. Trying other mirror.
  11. base | 3.6 kB 00:00:00
  12. extras | 2.9 kB 00:00:00
  13. updates | 2.9 kB 00:00:00
  14. Resolving Dependencies
  15. --> Running transaction check
  16. ---> Package httpd.x86_64 0:2.4.6-99.el7.centos.1 will be installed
  17. --> Processing Dependency: httpd-tools = 2.4.6-99.el7.centos.1 for package: httpd-2.4.6-99.el7.centos.1.x86_64
  18. --> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-99.el7.centos.1.x86_64
  19. --> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
  20. --> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-99.el7.centos.1.x86_64
  21. --> Running transaction check
  22. ---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
  23. ---> Package apr-util.x86_64 0:1.5.2-6.el7_9.1 will be installed
  24. ---> Package httpd-tools.x86_64 0:2.4.6-99.el7.centos.1 will be installed
  25. ---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
  26. --> Finished Dependency Resolution
  27. Dependencies Resolved
  28. ==================================================================================================================================================================================================================
  29. Package Arch Version Repository Size
  30. ==================================================================================================================================================================================================================
  31. Installing:
  32. httpd x86_64 2.4.6-99.el7.centos.1 updates 2.7 M
  33. Installing for dependencies:
  34. apr x86_64 1.4.8-7.el7 base 104 k
  35. apr-util x86_64 1.5.2-6.el7_9.1 updates 92 k
  36. httpd-tools x86_64 2.4.6-99.el7.centos.1 updates 94 k
  37. mailcap noarch 2.1.41-2.el7 base 31 k
  38. Transaction Summary
  39. ==================================================================================================================================================================================================================
  40. Install 1 Package (+4 Dependent packages)
  41. Total download size: 3.0 M
  42. Installed size: 10 M
  43. Downloading packages:
  44. Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
  45. (1/5): apr-1.4.8-7.el7.x86_64.rpm | 104 kB 00:00:00
  46. (2/5): apr-util-1.5.2-6.el7_9.1.x86_64.rpm | 92 kB 00:00:00
  47. (3/5): httpd-tools-2.4.6-99.el7.centos.1.x86_64.rpm | 94 kB 00:00:00
  48. (4/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00:00
  49. (5/5): httpd-2.4.6-99.el7.centos.1.x86_64.rpm | 2.7 MB 00:00:05
  50. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  51. Total 519 kB/s | 3.0 MB 00:00:05
  52. Running transaction check
  53. Running transaction test
  54. Transaction test succeeded
  55. Running transaction
  56. Installing : apr-1.4.8-7.el7.x86_64 1/5
  57. Installing : apr-util-1.5.2-6.el7_9.1.x86_64 2/5
  58. Installing : httpd-tools-2.4.6-99.el7.centos.1.x86_64 3/5
  59. Installing : mailcap-2.1.41-2.el7.noarch 4/5
  60. Installing : httpd-2.4.6-99.el7.centos.1.x86_64 5/5
  61. Verifying : httpd-2.4.6-99.el7.centos.1.x86_64 1/5
  62. Verifying : mailcap-2.1.41-2.el7.noarch 2/5
  63. Verifying : apr-1.4.8-7.el7.x86_64 3/5
  64. Verifying : httpd-tools-2.4.6-99.el7.centos.1.x86_64 4/5
  65. Verifying : apr-util-1.5.2-6.el7_9.1.x86_64 5/5
  66. Installed:
  67. httpd.x86_64 0:2.4.6-99.el7.centos.1
  68. Dependency Installed:
  69. apr.x86_64 0:1.4.8-7.el7 apr-util.x86_64 0:1.5.2-6.el7_9.1 httpd-tools.x86_64 0:2.4.6-99.el7.centos.1 mailcap.noarch 0:2.1.41-2.el7
  70. Complete!

从上面的日志来看,确实是从阿里云的镜像站点下载了软件包。在YUM配置中,使用了默认的镜像站点作为软件包的下载源。

配置成功!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/353250
推荐阅读
相关标签
  

闽ICP备14008679号