13

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
  • 1
    why not install directly from the repos? sudo apt-get install pandoc – amc Sep 4 '13 at 14:46
  • great,thanks that worked! feel free to convert to an answer and I'll accept it. – tim peterson Sep 4 '13 at 15:09
16

You can install directly from the repos:

sudo apt-get install pandoc
  • 5
    I get pandoc 1.9.1.1 by this way. Isn't there a newest version available ? – Stéphane Laurent Feb 6 '14 at 18:34
18

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/


  • 2
    This is was by far the easier solution to getting the newest version of Pandoc installed on my DigitalOcean vps. The apt-get version was 1.12 (I believe) and downloading the latest package with this method installed v1.17, which includes the wonderful feature of converting from docx, which i what I was after. Thanks @Ben! – TheBrockEllis Mar 30 '16 at 17:32
  • This was by far the easiest way for me, too, for 1.19.1 (from 1.17.1). I love pandoc but I do find it terribly hard to install, and this worked like a charm. – Chris Beeley Jan 18 '17 at 14:27
  • Yep, apt-get for Ubuntu 14 in 2017 was useless so this was a lifesaver (no exaggeration given how awesome pandoc is). – Sridhar Sarnobat Mar 31 '17 at 7:00
  • I downloaded the latest *.deb release (in my case, 2.1.1) from Github and installed it in 18.04 (pre-release) with the GDebi Package Manager. Worked a treat. Makes life much easier!! – Dɑvïd Jan 25 '18 at 11:34
12

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!

2

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!

  • do you get a version more recent than 1.9.1.1 by this way ? – Stéphane Laurent Feb 6 '14 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.