6

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.)

1
  • 1
    I was getting same message - "my-prog: fd:6: hGetContents: invalid argument (invalid byte sequence)" and running it with LANG=en_US.utf8 helped me. Commented Aug 12, 2014 at 18:51

1 Answer 1

7

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.

2
  • @olimay Please accept the answer (and vote it up) if it has solved your problem.
    – belacqua
    Commented Apr 2, 2011 at 0:41
  • I had the same problem, and your solution fixed it. Thanks a lot!
    – gphilip
    Commented Apr 6, 2011 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .