title: Error installing r package code tools
body: <p>Im trying to update the codetools package and get the same error is I use update.package() or install.package(), as shown below.  Any insight is appreciated:</p>
  
  <pre><code>R&gt; install.packages("codetools", lib = "/usr/lib/R/library")
  trying URL 'https://cran.rstudio.com/src/contrib/codetools_0.2-14.tar.gz'
  Content type 'application/x-gzip' length 12938 bytes (12 KB)
  ==================================================
  downloaded 12 KB
  
  * installing *source* package ‘codetools’ ...
  ** package ‘codetools’ successfully unpacked and MD5 sums checked
  mv: cannot move ‘/usr/lib/R/library/codetools’ to ‘/usr/lib/R/library/00LOCK-codetools/codetools’: Permission denied
  Warning in file.copy(f, instdir, TRUE) : problem copying ./NAMESPACE to /usr/lib/R/library/codetools/NAMESPACE: Permission denied
  Warning in file(file, ifelse(append, "a", "w")) : cannot open file '/usr/lib/R/library/codetools/DESCRIPTION': Permission denied
  Error in file(file, ifelse(append, "a", "w")) : cannot open the connection
  ERROR: installing package DESCRIPTION failed for package ‘codetools’
  * removing ‘/usr/lib/R/library/codetools’
  Warning in install.packages : installation of package ‘codetools’ had non-zero exit status
  
  The downloaded source packages are in
  ‘/tmp/RtmpiJWb8L/downloaded_packages’
  Updating HTML index of packages in '.Library'
  Warning in install.packages : cannot create file '/usr/share/R/doc/html/packages.html', reason 'Permission denied'
  Warning in install.packages : cannot update HTML package index
  </code></pre>