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

 

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

### 如何在 CentOS 7使用 yum 安装 PostgreSQL #### 准备工作 确保系统已经配置好基础的 `yum` 源。如果缺少 Base 源,可以通过阿里云镜像获取并保存到 `/etc/yum.repos.d/` 目录下[^2]。 ```bash curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo ``` #### 添加 PostgreSQL YUM 源 为了获得最新的版本和支持,建议先添加官方的 PostgreSQL 的 YUM 源: ```bash sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm ``` 这一步骤会安装来自 PostgreSQL Global Development Group (PGDG) 提供的仓库文件,从而允许访问更多更新版本的软件包[^1]。 #### 安装 PostgreSQL 及其扩展组件 接着执行命令来安装服务器端程序以及一些有用的工具和库: ```bash sudo yum install -y postgresql12-server postgresql-contrib ``` 这里选择了特定版本 (`postgresql12`) 来进行安装;当然也可以选择其他可用版本,具体取决于需求和个人偏好[^3]。 #### 初始化数据库集群 完成上述操作之后,需要初始化一个新的数据库实例: ```bash postgresql-setup initdb ``` 此过程会在默认位置建立必要的目录结构,并设置初始参数以便后续正常使用。 #### 设置开机自启和服务启动 为了让 PostgreSQL 随着系统的启动而自动运行,需将其加入到系统的服务列表中去: ```bash sudo systemctl enable postgresql sudo systemctl start postgresql ``` 最后确认服务已成功开启: ```bash sudo systemctl status postgresql ``` 以上就是完整的基于 `yum` 工具链,在 CentOS 7 平台上部署 PostgreSQL 数据库管理系统的过程概述[^4]。 #### 访问新安装的 PostgreSQL 实例 通常情况下,默认创建了一个名为 `postgres` 的操作系统账户用于管理 PostgreSQL。要进入交互式的 SQL shell (即 psql),可按如下方式切换身份并连接至本地主机上的默认实例: ```bash su - postgres psql -U postgres ``` 这样就可以开始探索或构建自己的应用程序逻辑了!
评论 8
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值