【问题标题】:Facing issue while installing jq in centos在 centos 中安装 jq 时遇到问题
【发布时间】:2017-10-18 01:44:58
【问题描述】:

在 centos 上安装 jq 时,我遇到了一个问题。我已经运行了以下命令:

yum groupinstall "Development Tools"
yum install autoconf automake libtool python

之后我使用了pip install jq,但我遇到了这样的错误:

jq.c:8:22: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
                     ^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-akuaZu/jq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read                                                                                        ().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" 
instal --record /tmp/pip-04CW9h-record/install-record.txt --single-version-externally  
-managed --compile" failed with error code 1 in /tmp/pip-build-akuaZu/jq/

谁能帮帮我??

【问题讨论】:

    标签: centos jq


    【解决方案1】:

    以防万一有人在寻找不同的解决方案。

    这就是我在 Cent OS 7 中安装的方式,并且可以正常工作。确保您拥有 sudo 权限。

    安装程序解决方案

    yum install epel-release -y
    yum install jq -y
    jq --version
    

    输出为 jq-1.5

    Reference

    【讨论】:

    • +1 你也不能yum install epel-release jq -y。必须先安装 epel 存储库
    • 这应该是第一个答案。使用 yum 包管理器轻松管理更新
    • Fwiw,我用 yum 获得了 1.3 版本,因为旧的 CentOS,但想要一些更新的功能,所以我下载了二进制 jq-1.6,它似乎在 CentOS 6 下也能正常工作。 (我不擅长 yum 和相关的东西..)
    • 使用这种方法,当我运行yum install jq 时,会收到很长的失败消息。结尾是:Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
    【解决方案2】:

    这就是我在 CentOS 7 上安装它的方式:

    wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -O jq
    chmod +x jq
    

    然后

    mv jq /usr/local/bin
    

    【讨论】:

    • 请尽可能使用yum
    • @CodeMed yum 当时没有发生在 OP 或我身上。
    • jq 至今仍无法通过 yum 获得。
    【解决方案3】:

    安装 pre-req 并安装 jq

    $ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    
    $ sudo yum install jq -y
    

    更多使用信息..https://medium.com/@gchandra/install-jq-on-centos-7-459dd650baa3

    【讨论】:

      猜你喜欢
      • 2012-07-03
      • 2011-06-16
      • 2011-12-21
      • 2014-05-11
      • 2013-06-20
      • 2014-08-12
      • 2023-04-09
      • 2023-04-09
      • 2019-06-23
      相关资源
      最近更新 更多