CentOS7に15秒でjqコマンドをインストールする | 瀬戸内の雲のように

CentOS7に15秒でjqコマンドをインストールする

Posted: 2018-09-28


スポンサーリンク

目次

背景

APIなどを扱う時、多くはjson形式でデータのやり取りをするかと思います。

渡しの場合、linuxのCLIでAPIを叩くことが多いのですが、そんな時にもはやjqコマンドは必須と言うレベルで使っています。

しかしこのjqコマンド、CentOSには標準でインストールされていません。jqコマンドなしなんて無理なのに。。

でも大丈夫、jqコマンドはたった15秒でインストールできます。

 

(前提)環境

  • Amazon EC2
  • CentOS Linux release 7.5.1804 (Core)

 

手順

0. サマリ

たったの2コマンドでインストールできます。

# yum install epel-release
# yum install --enablerepo=epel jq

一応詳細を解説します。

 

詳細1. epelリポジトリのインストール

まず最初に、yumでepelリポジトリをインストールします。

yum install epel-release

結果は以下の通り。

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp-srv2.kddilabs.jp
 * extras: ftp-srv2.kddilabs.jp
 * updates: ftp-srv2.kddilabs.jp
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                   Arch                                Version                             Repository                           Size
=============================================================================================================================================================
Installing:
 epel-release                              noarch                              7-11                                extras                               15 k

Transaction Summary
=============================================================================================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                          |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                                                  1/1
  Verifying  : epel-release-7-11.noarch                                                                                                                  1/1

Installed:
  epel-release.noarch 0:7-11

Complete!

 
一瞬です。

 

2. jqのインストール

次に本番、jqコマンドのインストールを行います。

yum install --enablerepo=epel jq

 
結果は以下のような感じであればOKです。

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                  | 5.3 kB  00:00:00
 * base: ftp-srv2.kddilabs.jp
 * epel: ftp.iij.ad.jp
 * extras: ftp-srv2.kddilabs.jp
 * updates: ftp-srv2.kddilabs.jp
epel                                                                                                                                  | 3.2 kB  00:00:00
(1/3): epel/x86_64/group_gz                                                                                                           |  88 kB  00:00:00
(2/3): epel/x86_64/updateinfo                                                                                                         | 944 kB  00:00:00
(3/3): epel/x86_64/primary                                                                                                            | 3.6 MB  00:00:00
epel                                                                                                                                             12693/12693
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/jq-1.5-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for jq-1.5-1.el7.x86_64.rpm is not installed
(1/2): jq-1.5-1.el7.x86_64.rpm                                                                                                        | 153 kB  00:00:00
(2/2): oniguruma-5.9.5-3.el7.x86_64.rpm                                                                                               | 129 kB  00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        1.3 MB/s | 282 kB  00:00:00
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 (@extras)
 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
  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!

 
以上で完了です。とっても早いですね!


スポンサーリンク




コメント一覧

2022/05/20 23:19:00

crmzqsskさん

erythromycin for fish http://erythromycinn.com/#


2022/05/21 01:13:36

Wnbhwongeさん

coupons for levitra levitra prescription assistance https://glevitrargu.com/


2022/05/21 07:01:23

hsjkgvjzさん

order provigil pill brand modafinil 100mg brand provigil 200mg


2022/05/21 08:26:15

jkektmaxさん

buy modafinil generic


2022/04/08 04:28:00

Keezexictさん

tadalafil generic availability tadalafil bitcoin thundersplace


2022/04/08 16:48:07

Dbngplugsさん

max dose of sildenafil vardenafil vs sildenafil citrate


2022/04/08 22:45:36

Fnenvunnyさん

purchase viagra lowest viagra price


2022/04/09 07:36:15

AndaAudircurnさん

tadalafil 5mg generic cialis tadalafil


2022/04/09 12:27:20

Ntfbfplugsさん

cialis 20mg tadalafil cialis


2022/04/10 15:16:23

Crnnwongeさん

natural viagra alternative buy viagra cheap buy online viagra viagra alternative


2022/04/12 00:19:29

Kbwnexictさん

generic 100mg sildenafil best site to buy viagra


2022/04/12 13:25:24

Dennplugsさん

cialis from india online pharmacy help rx pharmacy discount card


2022/04/12 19:13:18

Fwbnvunnyさん

buy sildenafil us maxifort zimax sildenafil 50 mg


2022/04/13 17:53:59

Knrnexictさん

buy vyvanse online pharmacy sky pharmacy canada


2022/04/14 04:58:03

Dsnnplugsさん

walgreens pharmacy store locations online pharmacy tech training


2022/04/14 10:35:54

Fuupvunnyさん

sildenafil citrate & tadalafil tablets buy viagra us pharmacy


2022/04/14 17:11:17

AnuoAudircurnさん

viagra online pharmacy learn pharmacy technician online free


2022/04/15 00:35:18

Nbttplugsさん

trusted online store to buy cialis cialis no perscrtion


2022/04/16 01:39:19

Ckanwongeさん

levitra coupons 2016 levitra expired


2022/04/16 19:15:40

Enrnexictさん

cialis 36 hour dosage canadian cialis reviews


2022/04/17 07:37:11

Jtnnplugsさん

ivermectin paste for horses what is ivermectin


2022/04/17 18:49:00

AnnoAudircurnさん

buying viagra nz buy generic viagra online australia


2022/04/17 11:25:35

Auupvunnyさん

what is the difference between cialis and tadalafil tadalafil tablets 20 mg global


2022/04/18 04:42:28

Zbttplugsさん

ivermectin equine ivermectin?


2022/04/19 02:54:33

Wevgwongeさん

average cost of prescription drugs Zebeta


2022/04/20 03:21:32

Ennsexictさん

viagra without prescription in united states cheap viagra online fast shipping


2022/04/20 15:37:27

Jnnyplugsさん

cialis soft tabs canadian pharmacy generic cialis coupons


2022/04/21 11:59:25

nyyyplugsさん

levitra price walmart price levitra commercial


2022/04/20 19:13:30

Ahhpvunnyさん

cialis dapoxetine cialis at walmart


2022/04/21 01:30:31

AnuuAudircurnさん

planet pharmacy canada medstore online pharmacy


2022/04/22 09:11:34

Wnsnwongeさん

levitra dosing instructions levitra on line


2022/04/23 07:46:50

Eaaqexictさん

arthritis best rx pharmacy port charlotte fl


2022/04/23 19:55:48

Jmmplugsさん

pharmacy online canada pharmacy coupon code


2022/04/23 23:40:23

Ansnvunnyさん

canadian pharmacy shop Maxalt


2022/04/24 06:06:20

JyhAudircurnさん

walmart store 100 pharmacy best canadian prescription prices


2022/04/24 16:17:03

Ntcxplugsさん

non prescription online pharmacy pharmacy rx online


2022/04/25 13:59:57

Wnnhwongeさん

Rizact Avapro


2022/04/29 19:32:32

Ebbexictさん

big pharmacy online best drugstore shampoo https://dtupharmyjn.com/


2022/04/30 07:18:25

Jebplugsさん

cheap viagra generic canada generic viagra over the counter https://sgiviagraikn.com/


2022/04/30 11:02:19

Anbnvunnyさん

figral sildenafil 100 mg buy sildenafil online usa https://sildenafilkiol.com/


2022/04/30 17:20:54

JyhgAudircurnさん

ivermectin 1% cream ivermectin stromectol https://stromectolujlo.com/


2022/05/01 03:10:45

Nndnplugsさん

rx care pharmacy zephyrhills fl safeway pharmacy online prescription refill https://jzpharmacyukj.com/


2022/05/02 00:24:15

Wnbhwongeさん

buy levitra uk which is better viagra cialis or levitra https://glevitrargu.com/


2022/05/03 21:51:11

Ebbeexictさん

cialis price cvs cialis online cheap https://dccialisxvf.com/


2022/05/04 09:17:03

Jebnplugsさん

online pharmacy reviews forum pharmacy rx world canada


2022/05/04 19:34:22

JolwAudircurnさん

canada pharmacy viagra can i buy viagra over the counter in south africa https://aviagrasbt.com/


2022/05/05 04:36:33

Nndenplugsさん

side effects levitra how is levitra different from viagra https://xclevitradb.com/


2022/05/07 10:17:41

ijvsmnさん

plaquenil sulfate 200 mg how to make hydroxychloroquine


2022/05/09 15:59:16

Ebbeexictさん

best place to get cialis without pesricption cost of cialis 5 mg https://dccialisxvf.com/


2022/05/10 03:01:23

Jebnplugsさん

canadian drug pharmacy reviews pharmacy rx one legit


2022/05/10 06:45:09

Anbnvunnyさん

where to buy sildenafil citrate sildenafil 150 mg https://sildenafilkiol.com/


2022/05/10 13:11:50

JolwAudircurnさん

where to purchase female viagra order sildenafil no prescription https://aviagrasbt.com/


2022/05/10 22:01:24

Nndenplugsさん

levitra for premature ejaculation levitra 10 mg schmelztabletten https://xclevitradb.com/


2022/05/11 18:35:48

Wnbhwongeさん

how much levitra should i take buy levitra pills online https://glevitrargu.com/


2022/05/14 10:14:02

EvaleenOaOaさん

law dissertation writing service
british dissertation help
dissertation methodology


2022/05/15 05:13:43

MaggeeOaOaさん

dissertation structure
buy a dissertation online help
mba dissertation writing


2022/05/15 05:56:31

Jebnplugsさん

mailing prescription drugs across state lines ca board of pharmacy


2022/05/15 09:35:35

Anbnvunnyさん

sildenafil 100mg how long does it last sildenafil side effects with alcohol https://sildenafilkiol.com/


2022/05/15 16:39:49

ghvqfkuaさん

provigil order buy modafinil 200mg oral provigil 200mg


2022/05/16 01:24:24

Nndenplugsさん

best prices levitra 20mg levitra 20 mg cheap https://xclevitradb.com/


2022/05/16 04:13:34

RegineOaOaさん

dissertation writing course
phd dissertation help download
medical dissertation writing service


2022/05/18 10:06:21

lwlbgyphさん

modafinil online order modafinil 100mg uk buy generic modafinil 100mg


2022/05/18 21:25:29

Ebbeexictさん

how long does it take for cialis to work? cialis with no prescrption https://dccialisxvf.com/


2022/05/19 05:39:38

zrzclwpdさん

buy provigil order provigil


2022/05/19 06:56:01

hnmlixkgさん

provigil buy online order modafinil 200mg online cheap cost modafinil 100mg


2022/05/19 09:03:29

Jebnplugsさん

canadian pharmacy order online drug store


2022/05/19 12:46:55

Anbnvunnyさん

is sildenafil sold over the counter sildenafil cost per pill https://sildenafilkiol.com/


2022/05/19 16:41:32

yvxnahheさん

cheap provigil 200mg provigil brand


2022/05/19 16:53:14

KirstiOaOaさん

dissertation defense help
dissertation binding
dissertation defense presentation


2022/05/19 16:55:39

uwkmomsuさん

brand modafinil 100mg provigil 100mg for sale


2022/05/19 19:01:08

JolwAudircurnさん

generic viagra online canadian pharmacy viagra for women over the counter https://aviagrasbt.com/


2022/05/20 04:36:20

Nndenplugsさん

is levitra better than viagra levitra dosis https://xclevitradb.com/


2022/05/20 08:39:00

lvywhgymさん

buy modafinil without prescription order provigil 200mg generic oral provigil 200mg



コメントを投稿する


お名前


コメント内容





TOP back