TransWikia.com

Install Pandoc (required for docverter)

Ask Ubuntu Asked by tim peterson on February 19, 2021

For the life of me I can’t figure out how to install pandoc. I tried the approach recommended on its Github repo as well as all 3 approaches recommended on the pandoc site. I’m installing on Ubuntu 12.04 so I first did sudo apt-get install haskell-platform.

Here’s where the error occurred at each step:

1) Installing as recommended on the Github repo:

# cabal install --enable-tests
Registering zlib-conduit-1.0.0...
cabal: Error: some packages failed to install:
http-conduit-1.9.4.5 depends on mime-types-0.1.0.3 which failed to install.
mime-types-0.1.0.3 failed during the building phase. The exception was:
ExitFailure 9
pandoc-1.12 depends on mime-types-0.1.0.3 which failed to install.

2) Primary installation method on Pandoc site:

# cabal install pandoc
[35 of 45] Compiling Text.Pandoc.Parsing ( src/Text/Pandoc/Parsing.hs, dist/build/Text/Pandoc/Parsing.o )
cabal: Error: some packages failed to install:
pandoc-1.11.1 failed during the building phase. The exception was:
ExitFailure 9

3) “If my distribution has GHC 6.12”

# cabal install cabal-install
[46 of 67] Compiling Distribution.Simple.LocalBuildInfo ( Distribution/Simple/LocalBuildInfo.hs, dist/build/Distribution/Simple/LocalBuildInfo.o )
cabal: Error: some packages failed to install:
Cabal-1.16.0.3 failed during the building phase. The exception was:
ExitFailure 9
cabal-install-1.16.0.2 depends on Cabal-1.16.0.3 which failed to install.

4) Installing the tarball:

# cabal install pandoc
[23 of 45] Compiling Text.Pandoc.Writers.Texinfo ( src/Text/Pandoc/Writers/Texinfo.hs, dist/build/Text/Pandoc/Writers/Texinfo.o )
cabal: Error: some packages failed to install:
pandoc-1.11.1 failed during the building phase. The exception was:
ExitFailure 9

4 Answers

You can install directly from the repos:

sudo apt-get install pandoc

Correct answer by amc on February 19, 2021

I found that installing cabal took up a lot of disk space in my VM, so I prefer to use the deb that the pandoc developers provide. Here's what I do to download and install the current deb (for pandoc v15.1.1):

sudo wget https://github.com/jgm/pandoc/releases/download/1.15.1/pandoc-1.15.1-1-amd64.deb
sudo dpkg -i pandoc-1.15.1-1-amd64.deb

You can check the latest release numbers here: https://github.com/jgm/pandoc/releases/


Answered by Ben on February 19, 2021

As pointed out by Stephane Laurent, the version of pandoc in the repos is far from the newest and doesn't allow nice features such as handling citations with --biblio. I struggled to install the newest version using the instructions on the pandoc website and github but here's how I finally did it for Ubuntu 13.10.

  1. Install cabal

    sudo apt-get install cabal-install
    
  2. Update cabal package database

    cabal update
    
  3. Make sure that path to cabal is at start of PATH (tip from here)

    PATH=$HOME/.cabal/bin:$PATH
    
  4. Use cabal to install alex and happy

    cabal install alex happy
    
  5. Use cabal to install pandoc (and pandoc-citeproc if wanted)

    cabal install pandoc pandoc-citeproc
    
  6. Check pandoc version to confirm installed

    pandoc --version
    

You'll need to add the PATH=$HOME/.cabal/bin:$PATH command to your ~/.profile so it's available on your next restart. Happy converting!

Answered by JohnSG on February 19, 2021

I had similar issues trying to install pandoc on a 512 MB machine in the clouds. According to a comment for this question I was getting the ExitFailure 9 because GHC was receiving a SIGKILL because I was using too much memory. To me this explained the lack of any useful messages with verbose switched on. I turned off ghc optimizations by installing with cabal-dev install pandoc --ghc-options="-O0" and pandoc compiled fine with a far smaller memory footprint. This is not a smart idea if you are in a production environment though!

Answered by sh54 on February 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP