Devtools: install_github forces upgrade of packages already installed

Created on 26 Jun 2015  路  7Comments  路  Source: r-lib/devtools

I need a package that is broken by the latest version of igraph at the moment, so I install an archived first with devtools::install_version(). I then go and install the package I need using install_github(), but this upgrades me to the latest version of igraph.

Here the archived version is installed: https://travis-ci.org/cboettig/gpmanagement/builds/68427213#L2133

And here is install_github call updating it to the latest version: https://travis-ci.org/cboettig/gpmanagement/builds/68427213#L2756

Here is the travis file for this build: https://github.com/cboettig/gpmanagement/blob/d1ac025328dc34dc1bd77bdf465f04ba2d6747fa/.travis.yml

Am I just missing something or is this not the expected behavior?

Most helpful comment

Yeah, this is expected behaviour because I see a lot of people who have problems because (e.g.) they installed the latest ggplot2, but have an old version of dplyr. If you don't want to update the deps, do dep = FALSE.

All 7 comments

this also affects devtools::install, which similarly attempts to install the newer igraph (and all its new dependencies) rather than use the version already installed.

Just to make this a concise reproducible example:

devtools::install_version('igraph', '0.7.1', repo = 'http://cran.rstudio.com')
# This next command first upgrades igraph, which causes the installation to fail
devtools::install_github("nimble-dev/nimble/packages/nimble@stable")

note that the nimble package does not place any restrictions on version numbers of its dependencies (and its installation fails with igraph > 1.0, but works with 0.7.1). Or maybe @gaborcsardi can see if I'm just doing something wrong with respect to igraph or this installation?

I agree that this behavior is annoying and causes unexpected system changes when I'm debugging stuff. Maybe make it opt-in?

Yeah, this is expected behaviour because I see a lot of people who have problems because (e.g.) they installed the latest ggplot2, but have an old version of dplyr. If you don't want to update the deps, do dep = FALSE.

+1 for an option to disable automatic package upgrades. The problem with dep = FALSE is that it won't install required missing dependencies either, which causes the installation to fail.

We still need dependencies that are currently not installed, just not reinstall packages when a suitable version is available.

devtools::install_github("stanstrup/PredRet",subdir = "PredRetR", dependencies=FALSE, upgrade_dependencies=FALSE)

Still tries to install stanstrup/Rplot.extra even if it is already installed.
Any solution for that?

The installed Rplot.extra was not specified as a remote in the currently installed version if that makes a difference.

EDIT: install.packages("/usr/local/lib/R/PredRetR.tar.gz", type="source", dependencies=FALSE) works.

Package: PredRetR
Version: 0.55
Date: 2016-05-20
Title: PredRetR
Author: Jan Stanstrup <[email protected]>
Maintainer: Jan Stanstrup <[email protected]>
Depends: R (>= 2.14.0), rmongodb, ggplot2, shiny
Suggests: rCharts
Imports: stringr, mgcv, pracma, boot, parallel, plyr, reshape2, Rplot.extra, massageR, igraph, ini
Enhances: 
Description: Functions for PredRet prediction of retention times.
License: GPL (>= 2)
URL: None
biocViews: Metabolomics
Remotes: stanstrup/Rplot.extra, stanstrup/massageR

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bastistician picture bastistician  路  6Comments

shirdekel picture shirdekel  路  5Comments

Mullefa picture Mullefa  路  6Comments

stevecondylios picture stevecondylios  路  3Comments

coatless picture coatless  路  5Comments