centos7 升级curl命令
开篇:默认的curl版本太旧,需要升级,才可以支持http2协议
1、安装repo
[root@ ~]# rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel6/x86_64/city-fan.org-release-2-1.rhel6.noarch.rpm
2、查看当前repo中包含哪些curl版本
[root@ ~]# yum --showduplicates list curl --disablerepo="*" --enablerepo="city*"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* city-fan.org: www.city-fan.org
* city-fan.org-source: www.city-fan.org
city-fan.org | 3.0 kB 00:00
city-fan.org-debuginfo | 3.0 kB 00:00
city-fan.org-source | 3.0 kB 00:00
(1/3): city-fan.org-debuginfo/7/primary_db | 41 kB 00:01
(2/3): city-fan.org-source/7/primary_db | 356 kB 00:02
(3/3): city-fan.org/7/primary_db | 518 kB 00:02
Installed Packages
curl.x86_64 7.29.0-59.el7_9.1 @updates
Available Packages
curl.x86_64 7.79.0-4.0.cf.rhel7 city-fan.org
3、修改repo配置
[root@master ~]# vim /etc/yum.repos.d/city-fan.org.repo
[city-fan.org]
name=city-fan.org repository for Red Hat Enterprise Linux (and clones) $releasever ($basearch)
#baseurl=http://mirror.city-fan.org/ftp/contrib/yum-repo/rhel$releasever/$basearch
mirrorlist=http://mirror.city-fan.org/ftp/contrib/yum-repo/mirrorlist-rhel$releasever
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-city-fan.org
4、安装curl
如果报错执行这个
rpm --import https://mirror.city-fan.org/ftp/contrib/GPG-KEYS/RPM-GPG-KEY-city-fan.org-rhel-7
[root@master nghttp2-master]# yum install curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* city-fan.org: www.city-fan.org
city-fan.org | 3.0 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package curl.x86_64 0:7.29.0-59.el7_9.1 will be updated
---> Package curl.x86_64 0:7.79.0-4.0.cf.rhel7 will be an update
、、、、
Dependency Installed:
keyutils-libs-devel.x86_64 0:1.5.8-3.el7
krb5-devel.x86_64 0:1.15.1-50.el7
libcom_err-devel.x86_64 0:1.42.9-19.el7
libicu.x86_64 0:50.2-4.el7_7
libkadm5.x86_64 0:1.15.1-50.el7
libnghttp2.x86_64 0:1.33.0-1.1.el7
libpsl.x86_64 0:0.7.0-1.el7
libselinux-devel.x86_64 0:2.5-15.el7
libsepol-devel.x86_64 0:2.5-10.el7
libssh2-devel.x86_64 0:1.10.0-2.0.cf.rhel7
libverto-devel.x86_64 0:0.2.5-4.el7
nspr-devel.x86_64 0:4.25.0-2.el7_9
nss-devel.x86_64 0:3.53.1-7.el7_9
nss-softokn-devel.x86_64 0:3.53.1-6.el7_9
nss-softokn-freebl-devel.x86_64 0:3.53.1-6.el7_9
nss-util-devel.x86_64 0:3.53.1-1.el7_9
openssl-devel.x86_64 1:1.0.2k-21.el7_9
pcre-devel.x86_64 0:8.32-17.el7
zlib-devel.x86_64 0:1.2.7-19.el7_9
Updated:
curl.x86_64 0:7.79.0-4.0.cf.rhel7
Dependency Updated:
libcurl.x86_64 0:7.79.0-4.0.cf.rhel7
libcurl-devel.x86_64 0: