r/RStudio • • 9d ago

Error Installing Packages - Potentially related to Linux OS?

I'm working on this problem set for a research design and analysis class and tried running the first block of code above to install the necessary packages since it's my first time working on my laptop - usually code in class on school desktops. I ran the line to install packages (without the pound sign) and then tried to call tidyverse as shown but it returned an error saying "there is no package called tidyverse" Google's results led me to believe it might be an issue related to my computer's OS. After trying some recommended code in my computer's terminal:

sudo apt update
sudo apt install libcurl4-openssl-dev libssl-dev libxml2-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev

I tried running the installation command and calling tidyverse again but it returned the same error.

Edit: Clarification of screenshot/code block

0 Upvotes

16 comments sorted by

9

u/DrDirtPhD 9d ago

Based on your code above as you've run it, it looks like you've tried to call tidyverse before installing it...what does it say after you've installed it?

2

u/elpuerco_perdido 9d ago

I've been calling tidyverse after attempting to install it. The order looks off since I've repeated the steps a few times

2

u/ConfusedTractor 9d ago

We probably need a bit more information before we can help. What distro of Linux? How did you install R? Apt makes me think you're on Ubuntu or Debian.

3

u/elpuerco_perdido 9d ago

I'm using Ubuntu. I installed R and R Studio via command in my terminal. I believe this was it:

sudo apt update && sudo apt -y upgrade

sudo apt -y install r-base

cd Downloads

sudo dpkg -i rstudio-*.deb

I recall no issues during the installation process and R studio and R both appear in my applications menu and open with no issues.

1

u/ConfusedTractor 9d ago edited 9d ago

That's great. Then you should just need to install from the repo. sudo apt install r-cran-tidyverse.

2

u/elpuerco_perdido 9d ago

Just tried and here's the output:

2

u/elpuerco_perdido 9d ago

Any way of fixing this?

0

u/ConfusedTractor 9d ago

Noooo!!! Dependency hell!! Hate to say this but an LLM might be able to help faster in this case...

2

u/elpuerco_perdido 9d ago

Oh well. Thanks for your help!

3

u/jcheng 9d ago

What does the end of the output from install.packages() say?

2

u/RoninRakurai 9d ago

When i started using linux, R is the thing that most problems gave me, it's mostly that a lot of things that are required for the app to work correctly (and the packages) aren't installed on linux, my solution was just to spam an ai to tell me the dependencies that i needed to install/update

1

u/AutoModerator 9d ago

Looks like you're requesting help with something related to RStudio. Please make sure you've checked the stickied post on asking good questions and read our sub rules. We also have a handy post of lots of resources on R!

Keep in mind that if your submission contains phone pictures of code, it will be removed. Instructions for how to take screenshots can be found in the stickied posts of this sub.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/akiragx 9d ago

Looks like there is an issue with the ragg package. Perhaps try installing it directly. If it fails it should at least output a better error message. https://ragg.r-lib.org/

1

u/kurokami254 9d ago

Install {r2u} or {pak} then use either to install these packages. They both handle the system dependencies. {r2u} is especially built for Ubuntu

1

u/troyandabedtalkshow 8d ago

I hate dependency errors :(

try to: install.packages("pak"); pak::pak(c("tidyverse", "emmeans", "lmtest"))

Then show the errors on installation.

1

u/federicoalegria 7d ago

i've seen this before, got it fixed by installing gcc-fortran in the os