LoginSignup
4
5

More than 3 years have passed since last update.

Pandoc をCentOS7にインストール [EPEL] 2018年07月版

Last updated at Posted at 2018-07-22

TL;DR

CentOS7 の yum 標準リポジトリは古いため epel リポジトリを追加して割と新しい pandoc をインストールする。

$ yum --enablerepo=epel update -y
$ yum -y install pandoc

Pandocとは

TS;DR

できることならソースからビルドしてインストールしたい。それが王道だし正しいのである。

しかし、(stack などの Haskell パッケージャー含め)ビルドのためだけに余計なモノを入れてメンテナンス対象を増やしたくもないのだ。

たとえ、それが「セキュリティ意識が低い」と罵られようが、「遠回りであっても最終的には近道」であると非合理の合理を説かれようが、「目先の合理性だけで結局は無駄が発生する」と言われようが、私は合理の非合理を取りたいのである。

何故ならば「メンテナンスと言っても、アップデートするだけでしょ?」と、雀も涙目なことをおっしゃるお客様から「(Markdown はよくわからないから)Word におこして PDF で送って」と言うんだもの。

そう、運用コストを減らすために yum update で済ませたいんだよ。本当はね、できることならリ・ビルドすらシェルで組んでは「バッチコーイ」とお尻ペンペンしたいんだよ。嗚呼、単純作業のお出ましだ。

準備
$ su -
$ 
$ # OS のバージョン確認
$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core) 
$ 
$ # yum のバージョン確認
$ yum --version
3.4.3
インストール: rpm-4.11.3-32.el7.x86_64 (日時: 2018-05-30 01:38)
  構築      : CentOS BuildSystem <http://bugs.centos.org>  (日時: 2018-04-11 03:54)
  コミット  : Panu Matilainen <pmatilai@redhat.com> (日時: 2017-11-13)

インストール: yum-3.4.3-158.el7.centos.noarch (日時: 2018-05-30 01:38)
  構築      : CentOS BuildSystem <http://bugs.centos.org>  (日時: 2018-04-13 12:58)
  コミット  : CentOS Sources <bugs@centos.org> (日時: 2018-04-10)

インストール: yum-plugin-fastestmirror-1.1.31-45.el7.noarch (日時: 2018-05-30 01:38)
  構築      : CentOS BuildSystem <http://bugs.centos.org>  (日時: 2018-04-11 04:16)
  コミット  : Valentina Mukhamedzhanova <vmukhame@redhat.com> (日時: 2017-11-21)
$ 
$ # epel リポジトリが追加されているか確認
$ yum repolist | grep epel
$ 
$ # epel リポジトリが追加されていない場合
$ yum install epel-release -y
$ yum --enablerepo=epel update -y
$ 
$ # Pandoc のパッケージ確認 
$ yum list | grep pandoc
ghc-pandoc.x86_64                        1.12.3.1-2.el7                 @epel   
ghc-pandoc-types.x86_64                  1.12.3.1-3.el7                 @epel   
pandoc.x86_64                            1.12.3.1-2.el7                 @epel   
ghc-pandoc-citeproc.x86_64               0.3.0.1-3.el7                  epel    
ghc-pandoc-citeproc-devel.x86_64         0.3.0.1-3.el7                  epel    
ghc-pandoc-devel.x86_64                  1.12.3.1-2.el7                 epel    
ghc-pandoc-types-devel.x86_64            1.12.3.1-3.el7                 epel    
pandoc-citeproc.x86_64                   0.3.0.1-3.el7                  epel    
pandoc-pdf.x86_64                        1.12.3.1-2.el7                 epel    
python2-pypandoc.noarch                  1.3.3-2.el7                    epel    
python34-pypandoc.noarch                 1.3.3-2.el7                    epel   
Pandocのインストール
$ # Pandoc のインストール
$ yum install pandoc
$ 
$ # Pandoc のバージョン確認
$ pandoc --version
pandoc 1.12.3.1
Compiled with texmath 0.6.6, highlighting-kate 0.5.6.
Syntax highlighting is supported for the following languages:
    actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c, changelog,
    clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, curry, d,
    diff, djangotemplate, doxygen, doxygenlua, dtd, eiffel, email, erlang,
    fortran, fsharp, gnuassembler, go, haskell, haxe, html, ini, java, javadoc,
    javascript, json, jsp, julia, latex, lex, literatecurry, literatehaskell,
    lua, makefile, mandoc, markdown, matlab, maxima, metafont, mips, modelines,
    modula2, modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml,
    octave, pascal, perl, php, pike, postscript, prolog, python, r,
    relaxngcompact, restructuredtext, rhtml, roff, ruby, rust, scala, scheme,
    sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, texinfo, verilog, vhdl,
    xml, xorg, xslt, xul, yacc, yaml
Default user data directory: /root/.pandoc
Copyright (C) 2006-2013 John MacFarlane
Web:  http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.  There is no
warranty, not even for merchantability or fitness for a particular purpose.
基本的なPandocの使い方
$ ls
gizirock_20190508.md
$ 
$ pandoc gizirock_20190508.md -f markdown -t docx -o MTG_20190508-KEINOS.docx
...
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5