How to reinstall pandoc after removing .cabal?

231 views Asked by At

I have mistakenly removed /root/.cabal/ from my root directoty and when I tried to reinstall it I get this output:

faiz:~$ sudo cabal install pandoc --reinstall
Resolving dependencies...
In order, the following will be installed:
pandoc-1.14.0.4 (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main             ( /tmp/pandoc-1.14.0.4-7040/pandoc-1.14.0.4/Setup.hs, /tmp/pandoc-1.14.0.4-7040/pandoc-1.14.0.4/dist/setup/Main.o )
Linking /tmp/pandoc-1.14.0.4-7040/pandoc-1.14.0.4/dist/setup/setup ...
Configuring pandoc-1.14.0.4...
Building pandoc-1.14.0.4...
Preprocessing library pandoc-1.14.0.4...

src/Text/Pandoc.hs:183:8:
Could not find module `Text.Parsec.Error'
There are files missing in the `parsec-3.1.9' package,
try running 'ghc-pkg check'.
Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
pandoc-1.14.0.4 failed during the building phase. The exception was:
ExitFailure 1

What should I do to reinstall pandoc again? I also want to know what's the difference in installing pandoc (using cabal) from the root command line (#) and installing it using the sudo command? (sudo cabal install pandoc)

1

There are 1 answers

0
Faiz Lotfy On

Solved!

Since I removed (deleted) the /root/.cabal/ directory (by mistake) my system could still detect that some other packages were there and as a result complained that the system already has the required packages and files. This was because of the /root/.ghc/ folder which was still there. removing this folder, and the two corresponding local folders ~/.cabal and ~/.ghc and using cabal install pandoc solved my issue.