#!/usr/bin/env bash
# conda activate jq_install_env
# - Install jq without sudo
# Clone the jq repository from GitHub
cd $HOME
git clone https://github.com/stedolan/jq.git $HOME/jq
cd $HOME/jq
git submodule update --init
# Compile jq from source
cd $HOME/jq
autoreconf -fi
./configure --with-oniguruma=builtin --disable-maintainer-mode --prefix=$HOME/.local
make -j8 && make check
make install
ls $HOME/.local
ls $HOME/.local/bin
# Add the directory where the jq binary file is located to your PATH environment variable
echo 'PATH=$PATH:~/.local/bin/' >> $HOME/.bashrc.lfs
export PATH=$PATH:~/.local/bin/
echo $PATH | tr ':' '\n'
# Reload your shell configuration file to update your PATH environment variable
source $HOME/.bashrc.lfs
# Verify that jq is installed and working
jq --version
Landing Page...
AboutCategoriesAdvisors
Recipe for building jq from source without admin(sudo) rights
Mar 31, 2020
This took me some time to install. Just putting it out there in case it helps someone.
Get the latest jq from github
git clone https://github.com/stedolan/jq.git
Update submodules (onigurama)
git submodule update --init
Copy missing auxiliary files
autoreconf -fi
Install into {YOUR_HOME_DIR} with onigurama (regex library)
./configure --with-oniguruma=builtin --disable-maintainer-mode --prefix={YOUR_HOME_DIR}.local
Check that we have all the dependencies downloaded and install
make -j8 && make check
make install
Finally, add this to your ~/.bashrc and to call jq from anywhere. Remember to >source ~/.bashrc and you should be good to go.
export PATH=$PATH:~/.local/bin/
« The Sigmoid in Regression, Neural Network Activation and LSTM GatesA minimum keystroke (py)Debugger for Lazy ML/DS people who don't IDE »
Quality means doing it right when no one is looking - Henry Ford
suzyahyah
suzyahyah
The best time to plant a tree was 20 years ago. The second best time is now. - Japanese proverb
Since October 2017
5条答案
按热度按时间lsmepo6l1#
可以执行
sudo apt-get install jq
,但是您需要通知系统在哪里可以找到jq。安装
1.在文本编辑器中打开源文件:
1.将以下行添加到该文件的末尾(注意
deb
不是命令,more info):deb http://us.archive.ubuntu.com/ubuntu生动的主宇宙
1.然后重新索引apt-get,以便它可以找到
jq
:1.然后进行正常安装,您应该是
jq
的新用户!测试
测试它的工作原理!试试这个,看看它漂亮的打印一些例子json
在您的终端中,结果应该如下所示:
busg9geu2#
由于Ubuntu 16.04LTS xenial,您无需修改
/etc/apt/sources.list
,只需运行jq 1.5
位于官方Debian和Ubuntu存储库中。w46czmvw3#
我觉得你错过了回购:http://installion.co.uk/ubuntu/vivid/universe/j/jq/install/index.html
kiz8lqtg4#
按照https://stedolan.github.io/jq/download/中所述从源代码下载和构建,最后一节称为“从Linux、OS X、Cygwin和其他类似POSIX的操作系统上的源代码”。
wn9m85ua5#
如果您没有sudo权限,请执行以下操作:
参考:https://suzyahyah.github.io/misc/2020/03/31/jq-without-sudo.html
如果连接器死亡: