Removed /root/.cabal by mistake - how to solve this issue?

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

The problem, I believe has to deal with Haskell installation. I have no experience with Haskell, and I only need a package called "pandoc" for some work with R. 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.) I use a netbook that has crunchbang linux (basically Debian Wheezy)

I'm guessing you do no have a backup.

We cannot know particulars, but try to uninstall as much as possible. You are in a situation where you have pieces of an application installer/application already on the system.

Displaying my ignorance: /root/.cabal <- is this the default path for the application?

The differences in how you run are determined - if there are any - by the /etc/sudoers file. I am assuming a vanilla install of sudo.

Thanks for the reply. No, I don't have a backup. I first installed cabal-install and cabal-debian then I installed pandoc. For some reason (not a sane one for sure) I deleted /root/.cabal/ and as you said, my system still thinks it is still there. I was hoping to find out what causes my system to still think it is still there. /root/.cabal contained a .config/ folder which is not there any more so I do not know what to do. Reinstalling also gives error.

---------- Post updated at 03:00 PM ---------- Previous update was at 02:27 PM ----------

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.

1 Like

Thanks for telling us the solution. It may help others in the future.