Unable to successfully install ggplot2 package


I am unable to successfully install the ggplot2 package on my RStudio IDE installation (Version 1.1.463) running on my Fedora 29 laptop.

I have tried many, many different suggestions on many, many different threads, both on this portal and also on StackExchange...and r-Bloggers...and others. I will list them for reference below. Meanwhile, one of the most recent strategies I have attempted was simply trying to install one of the many, many dependencies of ggplot2. In one case, I tried to simply install the package stringr first, right? Here is a flavor of the errors I am getting
from that (sub)installation:

* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in library.dynam(lib, package, package.lib) : 
  shared object ‘stringi.so’ not found
ERROR: lazy loading failed for package ‘stringr’
* removing ‘/home/r0r0/R/x86_64-redhat-linux-gnu-library/3.5/stringr’
Warning in install.packages :
  installation of package ‘stringr’ had non-zero exit status
ERROR: dependency ‘stringr’ is not available for package ‘knitr’
* removing ‘/home/r0r0/R/x86_64-redhat-linux-gnu-library/3.5/knitr’
Warning in install.packages :
  installation of package ‘knitr’ had non-zero exit status
ERROR: dependencies ‘knitr’, ‘stringr’ are not available for package ‘rmarkdown’
* removing ‘/home/r0r0/R/x86_64-redhat-linux-gnu-library/3.5/rmarkdown’
Warning in install.packages :
  installation of package ‘rmarkdown’ had non-zero exit status

The downloaded source packages are in

NOTE: I see that a recurrent issue from the above is the following:

** byte-compile and prepare package for lazy loading
Error in library.dynam(lib, package, package.lib) : 
  shared object ‘stringi.so’ not found

My hunch is that the above is key to the solution of my struggles, but I have yet to find what gets me there. ...

And I have indeed attempted using the Dependencies = TRUE parameter.
And indeed I have created an .Renviron file so that there are no permissions issues on directories as suggested here

Interestingly, as a side note, I was able to successfully install the rlang package, as suggested here, unlike many of the other dependencies, but that didn't really seem to help otherwise.

Another part of the error verbiage that RStudio is feeding to me is the following:

** package ‘openssl’ successfully unpacked and MD5 sums checked
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl@1.1 (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

And after successfully installing openssl-devel in my bash terminal for my fedora OS, it did not seem to help the issue in any case.

So with that, here is a short list of threads that I have already read with no help in my case:

And so wrapping up, the following are true:

  1. I am a newbie, but trying really hard here.
  2. I have done my homework to run down this issue to the best of my ability at this point.
  3. I am unable to successfully install ggplot2 and several of its dependencies on my Fedora 29 laptop, running RStudio Version 1.1.463
  4. I have a hunch that the key to my issue may well have to do with the following error segment:
Error in library.dynam(lib, package, package.lib) : 
  shared object ‘stringi.so’ not found
ERROR: lazy loading failed for package ‘stringr’

Please help and thanks in advance!

Solved with the following thread:

- Cannot install ggplot2: “Error in library.dynam(lib, package, package.lib) : shared object ‘stringi.so’ not found”

Specifically, the following,

The downloaded source packages are in
> install.packages("stringi",dep=TRUE)

Sorry to bother.

@perchslayer, you have been more than diligent! I run mainly OSX Mojave and Ubuntu 10.18 (Windows 10 when I have to), and haven't used Fedora, so I can only offer generic advice.

  1. Generally packages with dependencies will install them for you.
  2. All of the warning messages trace to the lost stringi.so file. Just because it can't be found doesn't mean it isn't there, it just means that it is not in the $PATH variable, which is the list of directories that installers use to look.
  3. As a self-deprecating newbie (you actually don't qualify being this deep into bug hunting gets you into at least beginner status :blush:), trouble-shooting $PATH problems is a steep hill better left for later.
  4. RStudio doesn't make this easier because it allows for custom search paths: https://support.rstudio.com/hc/en-us/articles/115014830827-Why-is-libPaths-different-in-RStudio-vs-R-
  5. You're behind a couple of versions. RStudio 1.2.1153 vs. 1.1.463, R 3.3.5 vs. R 3.3.1, which might be a source of complications best avoided. (And R 3.3.2 is right around the corner.)

Based on this, what I would do in face of the same issue, is a fresh install. I find that I've got more interesting things to do than to spend a day finding the one obscure flag in the one remote file two manually change.

  1. Confirm you are at the current version of Fedora.
  2. Install base R as instructed at http://blog.mclaughlinsoftware.com/2018/04/14/fedora-r-install/ which seems reliable.
  3. Open a CLI R terminal and install.packages('tidyverse') which will pull in ggplot2 and a lot of other stuff you will soon be using. All of these can be individually loaded withlibrary(ggplot2)`, etc.
  4. If that gives you a working R environment, the next step is to install RStudio, which provides a lot of functionality, especially if you're using RMarkdown.
  5. Download RStudio at https://www.rstudio.com/products/rstudio/download/ but don't use yum; there apparently have been some issues: https://support.rstudio.com/hc/en-us/community/posts/202635206-Dependencies-Fedora-20-R-3-1-0
  6. When you have RStudio installed, use the console to test your path library(ggplot) and if it works, you're were you want to be.
  7. If not, c'mon back for more "stump the chump" work. There are probably Fedora users who have more powerful magic on this than I do.

Good luck!


If your question's been answered (even by you!), would you mind choosing a solution ? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it properly:

But thanks for the title update anyway ! :wink:

Thank you ever so much for you prompt, detailed, and solid response and advice.

I actually used, as I recall, the "process" of installing R vis-a-vis installing the link to the library first and then doing the install of R. And it seems that there was no such choice that I could find for RStudio, maybe? So, I just installed it directly.

In any case, would you happen to have any advice as to how to properly UNINSTALL both R and RStudio (on my Fedora 29 Workstation---brand new....just released in late October), such that I am likely to have more success (than I have in the past with other software)?

I did get the install to work with deeper investigation, but I want to take your advice and start fresh with both R and RStudio in order to avoid (some) of similar in the future perhaps?

However, it seems that the uninstall process often proves not as elegant as the install and I would hate to not be able to to a reinstall because of leftover "baggage", right? Any advice that way?

Side Note: I made a point to get what I thought was an "up to date" version of R and RStudio for Fedora 29 (again, the latest rendition, as of late October 2018). But it is truly difficult to find what is, in effect, the latest for my OS. Are there possibly dependency issues that make the version I have the most recent available for Fedora 29? Or unlikely?

And thanks again!


In one way, I managed, in the end, to dig deeper and solve my own issue. However, as the kind helpful soul @technocrat pointed out, I may well have a deeper, more tangible, issue, in some respects, by having a version of R that is too old for now, generally.

Thus, should I hold off on marking it SOLVED until I have success with the fresh install of R > fresh install of ggplot2, etc? Or just mark it SOLVED from what I did?

Not trying to mince words here, but when is "SOLVED" truly "SOLVED"?

1 Like

This fixed it. Thanks everyone!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.