title: How to install system.random. Maybe cabal issue in version 8 of stack
body: <p>I am working on Ubuntu 16.04 with stack ghci version 8. I want to import System.Random in Haskell but it seems I am having trouble that may involve Cabal. I have seen similar posts on this website but they usually say it is because of an older version but I am using version 8.</p>
  
  <p>I get the error:</p>
  
  <pre><code>Failed to load interface for ‘System.Random’
  Use -v to see a list of the files searched for.
  </code></pre>
  
  <p>which tells me I have problems with System.Random. Looking online, I found that I need to first install Cabal.</p>
  
  <p>When I type </p>
  
  <pre><code>Cabal --version
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>cabal-install version 1.22.6.0
  using version 1.22.5.0 of the Cabal library 
  </code></pre>
  
  <p>which tells me I already have it. So when I try to update with</p>
  
  <pre><code>sudo apt-get install cabal-install cabal update
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  E: Unable to locate package cabal
  E: Unable to locate package update
  </code></pre>
  
  <p>which is weird. If I ignore it and try to install random anyways through</p>
  
  <pre><code>cabal install random
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Resolving dependencies...
  All the requested packages are already installed:
  random-1.1
  Use --reinstall if you want to reinstall anyway.
  </code></pre>
  
  <p>So it seems I also have the random package of cabal. But I can't load a program with the </p>
  
  <pre><code>import System.Random
  </code></pre>
  
  <p>command. </p>
  
  <p>EDIT: It seems I have stack ghci version 8.0.1 and ghci version 7.10.3.
  The System.random loads in ghci but not stack ghci.</p>
  
  <p>I also get the following when I try to load a file in stack. Entering</p>
  
  <pre><code>stack ghci R.hs
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Warning: Couldn't find a component for file target /home/aa/workspace/share/haskell/chenw/hw4/R.hs. Attempting to load anyway.
  Configuring GHCi with the following packages: 
  GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
  Loaded GHCi configuration from /home/aa/.ghc/ghci.conf
  Loaded GHCi configuration from /tmp/ghci19674/ghci-script
  </code></pre>
  
  <p>Does this mean there is something wrong with my install of stack?</p>