centos安装了curl却报 -bash: curl: command not found

前因

我服务器上想用curl下载docker-compress,发现没有curl命令,就去下载安装,安装完成之后,报-bash: curl: command not found

解决方法

bash 复制代码
[root@centos ~]# rpm -e --nodeps curl
warning: file /usr/bin/curl: remove failed: No such file or directory
 
[root@centos ~]# yum remove curl
Loaded plugins: fastestmirror, langpacks
No Match for argument: curl
No Packages marked for removal
 
[root@centos ~]# rpm -qa|grep curl
python-pycurl-7.19.0-19.el7.x86_64
libcurl-7.29.0-57.el7_8.1.x86_64
 
[root@centos ~]# yum -y install curl
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package curl.x86_64 0:7.29.0-57.el7_8.1 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
============================================================================================================================================
 Package                     Arch                          Version                                     Repository                      Size
============================================================================================================================================
Installing:
 curl                        x86_64                        7.29.0-57.el7_8.1                           updates                        271 k
 
Transaction Summary
============================================================================================================================================
Install  1 Package
 
Total download size: 271 k
Installed size: 528 k
Downloading packages:
curl-7.29.0-57.el7_8.1.x86_64.rpm                                                                                    | 271 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 5 pre-existing rpmdb problem(s), 'yum check' output follows:
abrt-addon-kerneloops-2.1.11-57.el7.centos.x86_64 has missing requires of curl
abrt-addon-xorg-2.1.11-57.el7.centos.x86_64 has missing requires of curl
2:postfix-2.10.1-9.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
2:postfix-2.10.1-9.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
rpm-4.11.3-43.el7.x86_64 has missing requires of curl
  Installing : curl-7.29.0-57.el7_8.1.x86_64                                                                                            1/1 
  Verifying  : curl-7.29.0-57.el7_8.1.x86_64                                                                                            1/1 
Installed:
  curl.x86_64 0:7.29.0-57.el7_8.1                                                                                                           
Complete!
 
 
[root@centos ~]# curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.44 zlib/1.2.7 libidn/1.28 libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets 
[root@centos ~]#

其实我第一次按照csdn一篇博客试了一下,是失败的,第二次又找了篇博客园的文章试了下,就成功了,但两篇文章的内容是一模一样的,也很离谱。

相关推荐
艾莉丝努力练剑2 分钟前
【Linux网络】Linux 网络编程:传输层协议TCP(三)
linux·运维·服务器·网络·tcp/ip·http
keyipatience7 分钟前
21,22 (半)深入理解Linux重定向与缓冲区机制
linux·运维·服务器
fengyehongWorld11 分钟前
Linux command 命令
linux
坤昱15 分钟前
cfs调度类深入解刨——最新内核细节分析3
linux·linux内核·deadline·cfs调度·eevdf·kernel 7.1·最新内核调度
2301_8035389517 分钟前
CentOS版本差异详解和系统信息查看方法
linux·运维·centos
灰灰老师17 分钟前
Docker部署Tomcat9
java·linux·docker·tomcat
Cx330❀17 分钟前
【Qt 核心机制篇】深度解析 Qt 信号与槽(Signals & Slots)机制:从底层原理、实战演练到 Lambda 进阶
linux·开发语言·c++·人工智能·qt·ubuntu
田里的水稻18 分钟前
OE_临时配置网络_linux系统终端命令行ip setting
linux·网络·tcp/ip
Cx330❀22 分钟前
【Linux网络】从零构建高性能UDP服务器:从Echo到英译汉业务级实现
大数据·linux·服务器·开发语言·网络·c++·udp
Amnesia0_030 分钟前
传输层协议UDP和TCP
linux·网络·tcp/ip·udp