Installing DESeq2 fails ; R can't find basic commands like 'rm' and 'mv'
Entering edit mode
mja18 ▴ 40
Last seen 7 weeks ago
United States

So this might not be a Bioconductor question per se, but the error revealed itself when trying to install a Bioconductor package.

When trying to install DESeq2, I am failing because the dependency 'SummarizedExperiment' will not install. The console error messages seem to indicate shell errors where basic commands such as 'rm' and 'mv' are not being found.

When I check R's PATH using Sys.getenv() , the PATH looks normal and has the place where these commands are.

I have a sneaking suspicion that Apple did this to me. I updated my OS from Mojave to Catalina, and ever since whenever I open a Terminal window I have a message saying:

The default interactive shell is now zsh. To update your account to use zsh, please runchsh -s /bin/zsh. For more details, please visit

Behind the scenes when R is trying to do my install, is it falling into a shell that doesn't even know where rm and mv are? If so, any ideas on how to fix this?

R version 4.0.0, Bioconductor version 3.11. Full console information below with sessionInfo() at bottom.

> BiocManager::install("DESeq2")
Bioconductor version 3.11 (BiocManager 1.30.10), R 4.0.0 (2020-04-24)
Installing package(s) 'DESeq2'
also installing the dependency ‘SummarizedExperiment’

  There is a binary version available but the source version is later:
                     binary source needs_compilation
SummarizedExperiment 1.18.1 1.18.2             FALSE

trying URL ''
Content type 'application/x-gzip' length 1887714 bytes (1.8 MB)
downloaded 1.8 MB

The downloaded binary packages are in
installing the source package ‘SummarizedExperiment’

trying URL ''
Content type 'application/x-gzip' length 1520747 bytes (1.5 MB)
downloaded 1.5 MB

* installing *source* package ‘SummarizedExperiment’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
sh: rm: command not found
** help
*** installing help indices
** building package indices
sh: rm: command not found
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: rm: command not found
sh: mv: command not found
Warning in system(paste("mv -f", shQuote(instdir), shQuote(dirname(final_instdir)))) :
  error in running command
ERROR:   moving to final location failed
sh: rm: command not found

The downloaded source packages are in
Warning message:
In install.packages(...) :
  installation of package ‘SummarizedExperiment’ had non-zero exit status

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] BiocManager_1.30.10 compiler_4.0.0      tools_4.0.0        

deseq2 install software error • 218 views
Entering edit mode

I don't have a mac, but this forum post says you might need xcode?

Try googling around with your specific errors like:

sh: rm: command not found
Entering edit mode

Thanks. I had full Xcode installed. I also installed xcode-select , per the post you linked to, then rebooted. Alas, did not fix it.

The googling mostly leads to people who have done something silly like

sudo /bin/rm /bin/rm

or messed up their path with a strange .bash_profile, which wasn't me! Normal shell commands still work on my device. It's just the install process from R that has issues.

Entering edit mode

It does indeed seem strange. I'd try to reproduce this in a simpler context, e.g.,

instdir <- tempfile(); dir.create(instdir)
final_instdir <- tempfile()
system(paste("mv -f", shQuote(instdir), shQuote(final_instdir)))

XCode should not been needed for binary package installation.

Entering edit mode


The tests you suggested all work fine in my R console. But the installation attempt still gives same errors for 'SummarizedExperiment' attempted installation.

Entering edit mode
mja18 ▴ 40
Last seen 7 weeks ago
United States

face <- palm

Turns out I had a bad line in my ~/.Renviron file that nuked the PATH. Fixing that solved my issue.

It was a bit confusing because, when Sys.getenv() was run from within an RStudio session, the reported PATH was fine. It was only when R was invoked from my terminal that I could see the PATH was not set correctly. It must be that during package installation the ~/.Renviron file was invoked.

Anyway, thanks for the suggestions.


Login before adding your answer.

Traffic: 594 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6