title: R install.packages() will not work on ubuntu vagrant vm
body: <p>I am trying to install packages in R, but after downloading, loading the package library will not work -- upon running <code>require("&lt;package_name&gt;")</code> or <code>library("&lt;package_name&gt;")</code> I get the error:</p>
  
  <blockquote>
    <p>Error in library("package_name") : there is no package called ‘package_name’</p>
  </blockquote>
  
  <p>I am running R 3.0.2 on Ubuntu 14.04.1, which is installed in a vagrant virtual machine running inside of os x mavericks. </p>
  
  <p>I have tried re-installing everything (R, Ubuntu, <code>sudo apt-get --reinstall install r-base-dev</code>). I have tried running R as root, all to no avail. </p>
  
  <p>I've found two other accounts of this problem:</p>
  
  <p><a href="https://stackoverflow.com/questions/21785616/ubuntu-12-04-r-install-packages-does-not-work-no-warning-no-install">Ubuntu 12.04 R install.packages() does not work. No warning, no install</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22601407/install-packages-rstudio-server-aws-ubuntu-error">install.packages() Rstudio server AWS ubuntu error</a></p>
  
  <p>And have tried the suggested solutions, but none of them work for me.</p>
  
  <p>A little more background on my install procedures; here is the sequence of commands I used to install R in ubuntu:</p>
  
  <pre><code>    sudo apt-get update
      echo "deb http://http://ftp.osuosl.org/pub/cran/bin/linux/ubuntu trusty/" &gt;&gt; ./sources.list.appendme
      sudo cat /etc/apt/sources.list ./sources.list.appendme  &gt; ./sources.list.tmp
      sudo mv ./sources.list.tmp /etc/apt/sources.list
      rm ./sources.list.appendme
      sudo apt-get install r-base
      sudo apt-get install r-base-dev
      sudo apt-get --reinstall install r-base-dev
  </code></pre>
  
  <p>This follows the instructions found here: <a href="http://cran.r-project.org/bin/linux/ubuntu/README" rel="nofollow noreferrer">http://cran.r-project.org/bin/linux/ubuntu/README</a> for installation of R in Ubuntu.</p>
  
  <p>Here are the install steps I used to make my virtual machine:</p>
  
  <pre><code>&gt; vagrant box add july24
  &gt; https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-i386-vagrant-disk1.box
  &gt; vagrant init july24 vagrant up
  </code></pre>
  
  <p>Here is a comparison of the output I get from running the package installation in my OS X R installation and my Ubunutu R installation. Interestingly, the downloaded package sizes are generally much smaller in the Ubunutu attempt (47KB and 26KB in OS X's R, vs 14KB and 0.9257KB in the Ubuntu R). Not sure if this is a difference between R versions (3.0.3/3.0.2 in OS X/Ubunutu), or because of different reqs for the different OSs..</p>
  
  <p>Correct, error-free package installation in OS X:</p>
  
  <blockquote>
    <blockquote>
      <p><code>install.packages("dataview",repos="http://cran.cs.wwu.edu")</code></p>
    </blockquote>
    
    <p>also installing the dependency ‘xtermStyle’</p>
    
    <p>trying URL
    '<a href="http://cran.cs.wwu.edu/bin/macosx/contrib/3.0/xtermStyle_2.2-4.tgz" rel="nofollow noreferrer">http://cran.cs.wwu.edu/bin/macosx/contrib/3.0/xtermStyle_2.2-4.tgz</a>'
    Content type 'application/x-gzip' length 49060 bytes (47 Kb) opened
    URL
    ================================================== downloaded 47 Kb</p>
    
    <p>trying URL
    '<a href="http://cran.cs.wwu.edu/bin/macosx/contrib/3.0/dataview_2.0-9.tgz" rel="nofollow noreferrer">http://cran.cs.wwu.edu/bin/macosx/contrib/3.0/dataview_2.0-9.tgz</a>'
    Content type 'application/x-gzip' length 27032 bytes (26 Kb) opened
    URL
    ================================================== downloaded 26 Kb</p>
    
    <p>The downloaded binary packages are in
    /var/folders/sy/w_z0czvs2nqd2ys0vf_827zc0000gn/T//RtmpOlT9rM/downloaded_packages</p>
    
    <blockquote>
      <p><code>library('dataview')</code> </p>
    </blockquote>
    
    <p>Loading required package: xtermStyle</p>
  </blockquote>
  
  <p>installation with the error in Ubuntu:</p>
  
  <blockquote>
    <blockquote>
      <p><code>install.packages("dataview",repos="http://cran.cs.wwu.edu")</code> </p>
    </blockquote>
    
    <p>Installing package into ‘/home/vagrant/R/i686-pc-linux-gnu-library/3.0’ (as ‘lib’ is
    unspecified) also installing the dependency ‘xtermStyle’</p>
    
    <p>trying URL
    '<a href="http://cran.cs.wwu.edu/src/contrib/xtermStyle_2.2-4.tar.gz" rel="nofollow noreferrer">http://cran.cs.wwu.edu/src/contrib/xtermStyle_2.2-4.tar.gz</a>' Content
    type 'application/x-gzip' length 15265 bytes (14 Kb) opened URL
    ================================================== downloaded 14 Kb</p>
    
    <p>trying URL '<a href="http://cran.cs.wwu.edu/src/contrib/dataview_2.0-9.tar.gz" rel="nofollow noreferrer">http://cran.cs.wwu.edu/src/contrib/dataview_2.0-9.tar.gz</a>'
    Content type 'application/x-gzip' length 9257 bytes opened URL
    ================================================== downloaded 9257 bytes</p>
    
    <p>The downloaded source packages are in
    ‘/tmp/RtmppaTkT7/downloaded_packages’</p>
    
    <blockquote>
      <p><code>library('dataview')</code> </p>
    </blockquote>
    
    <p>Error in library("dataview") : there is no package called ‘dataview’</p>
    
    <blockquote>
      <p><code>library('dataview',lib.loc='/home/vagrant/R/i686-pc-linux-gnu-library/3.0')</code></p>
    </blockquote>
    
    <p>Error in library("dataview", lib.loc ="/home/vagrant/R/i686-pc-linux-gnu-library/3.0") :<br>
    there is no package called ‘dataview’</p>
  </blockquote>
  
  <p>Maybe there is something I am missing? Your help or suggestions are greatly appreciated. </p>