https://www.yangxingzhen.com/6923.html

1. 安装repo

  1. $ rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/city-fan.org-release-2-1.rhel7.noarch.rpm

2. 修改 repo 文件

新增 /etc/yum.repos.d/city-fan.org.repo 文件,填充以下内容:

  1. [city-fan.org]
  2. name=city-fan.org repository for Red Hat Enterprise Linux (and clones) $releasever ($basearch)
  3. #baseurl=http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch
  4. mirrorlist=http://mirror.city-fan.org/ftp/contrib/yum-repo/mirrorlist-rhel$releasever
  5. enabled=1
  6. gpgcheck=1
  7. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org
  8. [city-fan.org-debuginfo]
  9. name=city-fan.org debuginfo repository for Red Hat Enterprise Linux (and clones) $releasever ($basearch)
  10. #baseurl=http://www.city-fan.org/ftp/contrib-debug/rhel$releasever/$basearch
  11. mirrorlist=http://www.city-fan.org/ftp/contrib-debug/mirrorlist-rhel$releasever
  12. enabled=1
  13. gpgcheck=1
  14. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org
  15. [city-fan.org-source]
  16. name=city-fan.org source repository for Red Hat Enterprise Linux (and clones) $releasever
  17. #baseurl=http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/source
  18. mirrorlist=http://mirror.city-fan.org/ftp/contrib/yum-repo/source-mirrorlist-rhel$releasever
  19. enabled=1
  20. gpgcheck=1
  21. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org

3. 安装最新版的curl

  1. # 安装依赖
  2. $ rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libnghttp2-1.33.0-1.1.el7.x86_64.rpm
  3. $ sudo yum update curl --enablerepo=city-fan.org -y