title: Shiny error: "/usr/bin/R: line 238: /usr/lib/R/etc/ldpaths: Permission denied"
body: <p>everything worked fine. I have R, R-Studio-Server and Shiny-Server running on a server.</p>
  <p>I just updated the system (or do not remember what else I did) and accidentally broke shiny-server.
  No matter which app I want to run it always gives me the Error:</p>
  <blockquote>
  <p>An error has occurred</p>
  <p>The application failed to start.</p>
  <p>The application exited during initialization.</p>
  <p>/usr/bin/R: line 238: /usr/lib/R/etc/ldpaths:
  Permission denied ERROR: R_HOME ('/usr/lib/R') not found</p>
  </blockquote>
  <p>For me it looks like a permission problem. But why does it pop up now and not before?</p>
  <p>As everything worked fine before, I reinstalled: R, the shiny package and shiny-server (3x times). But did not succeed.
  Because I think it also could be linked with the shiny user, I first removed the shiny user with:</p>
  <pre><code>deluser --remove-home shiny
  </code></pre>
  <p>I uninstalled R with:</p>
  <pre><code>apt-get --purge remove r-base-core
  dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P 
  </code></pre>
  <p>(or 2nd cmd see: <a href="https://stackoverflow.com/questions/20967256/error-on-package-and-r-paths-and-installations">Error on package and R paths and installations</a>)</p>
  <p>I deleted the shiny-server</p>
  <pre><code>apt-get remove shiny-server
  </code></pre>
  <p>rebooted and installed everything again.
  Nothing works.
  If I switch to shiny user it is also not possible to call R:</p>
  <pre><code>root@calculator:~# su shiny
  shiny@calculator:/root$ R
  /usr/bin/R: line 238: /usr/lib/R/etc/ldpaths: Permission denied
  ERROR: R_HOME ('/usr/lib/R') not found
  </code></pre>
  <p>What could be the reason for this problem?</p>
  <p>edit:</p>
  <p>In case it is important:</p>
  <blockquote>
  <p>lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 14.04.2 LTS
  Release:        14.04
  Codename:       trusty</p>
  </blockquote>
  <p>I installed R 3.2.1
  and the latest shiny-server with the provided code lines.</p>
  <p>Thanks and best regards</p>
  <p>Nico</p>