Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Having trouble installing ghc6.

Here's what seems to be the relevant error that comes up when I try to (apt-get|aptitude) install ghc6:

A package failed to install.  Trying to recover:
Setting up ghc6 (6.12.1-13ubuntu1) ...
ghc-pkg: /home/opm/.ghc/i386-linux-6.12.1/package.conf.d/unix-compat-0.2-edefa7bced91ebe610d455bab466e200.conf: hGetContents: invalid argument (invalid UTF-8 byte sequence)

(Here's the full output, if you're interested: http://paste.ubuntu.com/566475/ )

This still happens after apt-get clean and apt-get update.

My searching around has not really helped me understand what's going on, except that it might be caused by a mismatch in locale. So, here's the output of locale too:

LANG=en_US.utf8
LANGUAGE=en_US:en
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Any ideas?

Additional background: this all seems very strange to me, because I used to have ghc6 installed correctly--I use XMonad as my main window manager most of the time. I tried to install haskell-platform (through apt), which failed and told me that there was something wrong with ghc6, and so I reinstalled ghc6 and began to get the above error message.

(Originally posted here to SuperUser, until I remembered today that this SE site existed.)

share|improve this question
add comment

1 Answer 1

up vote 7 down vote accepted

Check the output of ghc-pkg list. I had the same problem, and in my case it was due to an old ~/.ghc/i386-linux-6.12.1/package.conf.d. Deleting ~/.ghc solved the problem for me.

share|improve this answer
    
That fixed things. Thanks! –  olimay Mar 4 '11 at 22:04
    
@olimay Please accept the answer (and vote it up) if it has solved your problem. –  belacqua Apr 2 '11 at 0:41
    
I had the same problem, and your solution fixed it. Thanks a lot! –  gphilip Apr 6 '11 at 8:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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