ToB企服应用市场:ToB评测及商务社交产业平台

标题: Linux(Centos7)更换为阿里yum源 [打印本页]

作者: 麻花痒    时间: 2024-12-14 08:57
标题: Linux(Centos7)更换为阿里yum源
1、替换Centos-Base.repo

  1. (1)备份
  2. cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
  3. (2)更换为阿里yum源:
  4. wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
复制代码
或手动创建编辑文件:/etc/yum.repos.d/CentOS-Base.repo
  1. # CentOS-Base.repo
  2. #
  3. # The mirror system uses the connecting IP address of the client and the
  4. # update status of each mirror to pick mirrors that are updated to and
  5. # geographically close to the client.  You should use this for CentOS updates
  6. # unless you are manually picking other mirrors.
  7. #
  8. # If the mirrorlist= does not work for you, as a fall back you can try the
  9. # remarked out baseurl= line instead.
  10. #
  11. #
  12. [base]
  13. name=CentOS-$releasever - Base - mirrors.aliyun.com
  14. failovermethod=priority
  15. baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
  16.         http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
  17.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
  18. gpgcheck=1
  19. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  20. #released updates
  21. [updates]
  22. name=CentOS-$releasever - Updates - mirrors.aliyun.com
  23. failovermethod=priority
  24. baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
  25.         http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
  26.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
  27. gpgcheck=1
  28. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  29. #additional packages that may be useful
  30. [extras]
  31. name=CentOS-$releasever - Extras - mirrors.aliyun.com
  32. failovermethod=priority
  33. baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
  34.         http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
  35.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
  36. gpgcheck=1
  37. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  38. #additional packages that extend functionality of existing packages
  39. [centosplus]
  40. name=CentOS-$releasever - Plus - mirrors.aliyun.com
  41. failovermethod=priority
  42. baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
  43.         http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  44.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
  45. gpgcheck=1
  46. enabled=0
  47. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
  48. #contrib - packages by Centos Users
  49. [contrib]
  50. name=CentOS-$releasever - Contrib - mirrors.aliyun.com
  51. failovermethod=priority
  52. baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
  53.         http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
  54.         http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
  55. gpgcheck=1
  56. enabled=0
  57. gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
复制代码
2、安装基本工具

   yum install -y gcc gcc-c++ make cmake wget lrzsz perl crontabs patch net-tools unzip zlib zlib-devel pcre pcre-devel libxml2 libxml2-devel bzip2-devel libcurl-devel ncurses ncurses-devel openssl openssl-devel telnet

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4