linux,Centos7,yum安装的curl无法正常使用

[root@centos ~]# yum -y install curl
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package curl-7.29.0-57.el7_8.1.x86_64 already installed and latest version
Nothing to do
[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
curl-7.29.0-57.el7_8.1.x86_64
[root@centos ~]# curl --version
-bash: curl: command not found

使用yum安装curl时,提示已经安装,但是curl相关命令无法使用,使用rpm查看,确认curl已经安装。

解决:卸载curl重新安装

[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 ~]#

 

CentOS 7上使用yum安装LNMP是一种方便且快捷的方法。首先,您需要准备工作并切换到里云yum源。具体步骤如: 1. 备份原有的yum源: `mv /etc/yum.repos.d/Cent-Base.repo /etc/yum.repos.d/COS-Base.repo.backup` 2. 下载新的CentOS-Base.repo到/etc/yum.repos.d/: `wget -O /etc/y.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo` 或者 `curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo` 3. 清理缓存: `yum clean all` 4. 生成缓存: `yum makecache` 接下来,您可以使用以下命令来安装LNMP包: `yum install epel-release` 安装EPEL以便安装源以外的软件,如Nginx、phpMyAdmin等。 最后,您可以使用以下命令启动服务: `service nginx start` 这是使用yum安装LNMP的步骤和命令。通过这种方法,您可以方便地安装LNMP并使用各种服务。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [centos7搭建LNMP环境-编译安装&yum安装-超详细](https://blog.csdn.net/handsomezls/article/details/116259445)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [centos7 使用YUM安装lnmp环境](https://blog.csdn.net/weixin_40288231/article/details/106334673)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值