22

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
Tim
  • 33,500
tim peterson
  • 2,345

5 Answers5

31

You can install directly from the repos:

sudo apt-get install pandoc
amc
  • 7,292
21

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/


Ben
  • 313
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!

JohnSG
  • 221
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!

sh54
  • 121
0

Because Pandoc has some dependencies, users need to install both pandoc and the dependencies to enable a success of pandoc usage for Ubuntu 20.04 (or 18.04).

1.Check dependencies

If you have a tensorflow env within Miniconda or Anaconda, please check the dependencies.

$ conda list

It will show nbclient, nbconvert, etc.

2.Install the lastest pandoc

Usage guide:

https://pandoc.org/installing.html

Download pandoc

https://github.com/jgm/pandoc/releases/tag/3.1.8

Installation

$ cd Downloads
$ sudo dpkg -i pandoc-3.1.8-1-amd64.deb

3.Install texlive-xetex

$ sudo apt-get update -y
$ sudo apt-get install -y texlive-xetex

After successful installation, users can download pdf from Jupyter Noterbook (ipynb document)

Mike Chen
  • 141