[root@localhost yum.repos.d]# yum list jq
Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks
Repository c7-media is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Error: No matching Packages to list
[root@localhost jq]# yum install jq
Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks
Repository c7-media is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
No package jq available.
Error: Nothing to do
/etc/yum.repo.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
把enabled=0 改为enabled=1
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[root@localhost yum.repos.d]# yum install jq
Loaded plugins: auto-update-debuginfo, fastestmirror, langpacks
Repository c7-media is listed more than once in the configuration
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 7.0 kB 00:00:00
epel-debuginfo/x86_64/metalink | 7.2 kB 00:00:00
* base: mirrors.aliyun.com
* epel: mirrors.tuna.tsinghua.edu.cn
* epel-debuginfo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
epel | 4.7 kB 00:00:00
epel-debuginfo | 3.0 kB 00:00:00
(1/4): epel/x86_64/group_gz | 88 kB 00:00:00
(2/4): epel/x86_64/updateinfo | 954 kB 00:00:00
(3/4): epel-debuginfo/x86_64/primary_db | 882 kB 00:00:01
(4/4): epel/x86_64/primary_db | 6.6 MB 00:00:06
Resolving Dependencies
--> Running transaction check
---> Package jq.x86_64 0:1.5-1.el7 will be installed
--> Processing Dependency: libonig.so.2()(64bit) for package: jq-1.5-1.el7.x86_64
--> Running transaction check
---> Package oniguruma.x86_64 0:5.9.5-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================
Package Arch Version Repository Size
===============================================================================================================
Installing:
jq x86_64 1.5-1.el7 epel 153 k
Installing for dependencies:
oniguruma x86_64 5.9.5-3.el7 epel 129 k
Transaction Summary
===============================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 282 k
Installed size: 906 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/oniguruma-5.9.5-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for oniguruma-5.9.5-3.el7.x86_64.rpm is not installed
(1/2): oniguruma-5.9.5-3.el7.x86_64.rpm | 129 kB 00:00:02
(2/2): jq-1.5-1.el7.x86_64.rpm | 153 kB 00:00:02
---------------------------------------------------------------------------------------------------------------
Total 127 kB/s | 282 kB 00:00:02
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-11.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : oniguruma-5.9.5-3.el7.x86_64 1/2
Installing : jq-1.5-1.el7.x86_64 2/2
Verifying : oniguruma-5.9.5-3.el7.x86_64 1/2
Verifying : jq-1.5-1.el7.x86_64 2/2
Installed:
jq.x86_64 0:1.5-1.el7
Dependency Installed:
oniguruma.x86_64 0:5.9.5-3.el7
Complete!
[root@localhost yum.repos.d]# jq
jq - commandline JSON processor [version 1.5]
Usage: jq [options] <jq filter> [file...]
jq is a tool for processing JSON inputs, applying the
given filter to its JSON text inputs and producing the
filter's results as JSON on standard output.
The simplest filter is ., which is the identity filter,
copying jq's input to its output unmodified (except for
formatting).
For more advanced filters see the jq(1) manpage ("man jq")
and/or https://stedolan.github.io/jq
Some of the options include:
-c compact instead of pretty-printed output;
-n use `null` as the single input value;
-e set the exit status code based on the output;
-s read (slurp) all inputs into an array; apply filter to it;
-r output raw strings, not JSON texts;
-R read raw strings, not JSON texts;
-C colorize JSON;
-M monochrome (don't colorize JSON);
-S sort keys of objects on output;
--tab use tabs for indentation;
--arg a v set variable $a to value <v>;
--argjson a v set variable $a to JSON value <v>;
--slurpfile a f set variable $a to an array of JSON texts read from <f>;
See the manpage for more options.