Errors when installing bioconductor packages in RStudio installed in Ubuntu 24.04

Hello,

I installed Ubuntu 24.04 and started preparing the machine for data analysis. I started installing R and RStudio using the following commands:
https://cran.r-project.org/bin/linux/ubuntu/fullREADME.html

sudo apt-get update
sudo apt-get install r-base

Then,

choose ubuntu

Then,

sudo apt update -qq

sudo apt install --no-install-recommends software-properties-common dirmngr

wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

Then,
sudo apt-get install r-base-dev

Then,

download RStudio for Ubuntu 24.04
$cd Download

$sudo dpkg -i rstudio-2024.09.0-375-amd64.deb

sudo apt install -f

I am able to successfully install packages from CRAN but encounter errors when attempting to install packages from Bioconductor.

Example of errors:
ERROR: dependencies ‘systemfonts’, ‘textshaping’ are not available for package ‘ragg’

  • removing ‘/home/raizada/R/x86_64-pc-linux-gnu-library/4.4/ragg’

Then, I ran

$sudo apt-get install libcurl4-openssl-dev r-base

Are there any specific libraries or dependencies that need to be installed on Ubuntu beforehand?

I have updates:
$sudo apt install r-cran-curl
Then, I installed devtools to install DADA2

install.packages("devtools")
library("devtools")
devtools::install_github("benjjneb/dada2", ref="v1.26")

but I got the error below:

ERROR: dependencies ‘Rsamtools’, ‘GenomicAlignments’ are not available for package ‘ShortRead’

  • removing ‘/home/raizada/R/x86_64-pc-linux-gnu-library/4.4/ShortRead’

Thanks!

Do you have the R packages systemfonts and textshaping installed? If not, what happens if you try to install them?

Hello,

Thanks for your suggestion.
I did the followings:

I did the following:

$sudo apt install libharfbuzz-dev libfribidi-dev

install.packages("textshaping", dependencies = TRUE)

$sudo apt install libfontconfig1-dev

install.packages("systemfonts", dependencies = TRUE)

but this did not help to install dada2

Then I tried this since it requires installing ShortRead package

BiocManager::install("ShortRead")
then dada2 was installed successfully

Thanks again!

You could give pak a go, it'll install system requirements automatically, and it'll also instal Bioconductor packages without any other package needed.
See All about installing pak. — Installing pak • pak

You can also use it to check the system requirements of packages:

❯ pak::pkg_sysreqs("ragg", sysreqs_platform="ubuntu-2404")
── Install scripts ──────────────────────────────────── Ubuntu 2404 ──
apt-get -y update
apt-get -y install libfreetype6-dev libjpeg-dev libpng-dev \
  libtiff-dev libfontconfig1-dev libfribidi-dev libharfbuzz-dev

── Packages and their system dependencies ────────────────────────────
ragg        – libfreetype6-dev, libjpeg-dev, libpng-dev, libtiff-dev
systemfonts – libfontconfig1-dev, libfreetype6-dev
textshaping – libfreetype6-dev, libfribidi-dev, libharfbuzz-dev

Thanks so much for your answer.
Yesterday, I installed devtools, and a few packages from bioconductor for metagenomic data analysis.
I wonder if I ran the code provided int the link:

install.packages("pak", repos = sprintf(
  "https://r-lib.github.io/p/pak/stable/%s/%s/%s",
  .Platform$pkgType,
  R.Version()$os,
  R.Version()$arch
))

, there will be any issue or redundancy in package installation?
Again, thanks!

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.