Why Does Apt-Get Install R-Base Install 3.2.3 Instead of 3.4.0 in R

Why does apt-get install r-base install 3.2.3 instead of 3.4.0 in R?

you need to install from the CRAN repos not the ubuntu ones. add the key, then the repository, update and the apt-get

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'

sudo apt-get update

sudo apt-get install r-base

How to install an R package to R-3.3.0 from GitHub, which is built on R-3.4.0?

You can find the description file for OPWeight here.

Change this part

Depends:
R (>= 3.4.0),

to whatever R you are using and see if things break. The logic of the description file is explained here. Obviously a last resort.

How should I deal with package 'xxx' is not available (for R version x.y.z) warning?

1. You can't spell

The first thing to test is have you spelled the name of the package correctly? Package names are case sensitive in R.


2. You didn't look in the right repository

Next, you should check to see if the package is available. Type

setRepositories()

See also ?setRepositories.

To see which repositories R will look in for your package, and optionally select some additional ones. At the very least, you will usually want CRAN to be selected, and CRAN (extras) if you use Windows, and the Bioc* repositories if you do any biological analyses.

To permanently change this, add a line like setRepositories(ind = c(1:6, 8)) to your Rprofile.site file.


3. The package is not in the repositories you selected

Return all the available packages using

ap <- available.packages()

See also Names of R's available packages, ?available.packages.

Since this is a large matrix, you may wish to use the data viewer to examine it. Alternatively, you can quickly check to see if the package is available by testing against the row names.

View(ap)
"foobarbaz" %in% rownames(ap)

Alternatively, the list of available packages can be seen in a browser for CRAN, CRAN (extras), Bioconductor, R-forge, RForge, and GitHub.

Another possible warnings message you may get when interacting with CRAN mirrors is:

Warning: unable to access index for repository

Which may indicate the selected CRAN repository is currently be unavailable. You can select a different mirror with chooseCRANmirror() and try the installation again.


There are several reasons why a package may not be available.


4. You don't want a package

Perhaps you don't really want a package. It is common to be confused about the difference between a package and a library, or a package and a dataset.

A package is a standardized collection of material extending R, e.g. providing code, data, or documentation. A library is a place (directory) where R knows to find packages it can use

To see available datasets, type

data()

5. R or Bioconductor is out of date

It may have a dependency on a more recent version of R (or one of the packages that it imports/depends upon does). Look at

ap["foobarbaz", "Depends"]

and consider updating your R installation to the current version. On Windows, this is most easily done via the installr package.

library(installr)
updateR()

(Of course, you may need to install.packages("installr") first.)

Equivalently for Bioconductor packages, you may need to update your Bioconductor installation.

source("http://bioconductor.org/biocLite.R")
biocLite("BiocUpgrade")

6. The package is out of date

It may have been archived (if it is no longer maintained and no longer passes R CMD check tests).

In this case, you can load an old version of the package using install_version()

library(remotes)
install_version("foobarbaz", "0.1.2")

An alternative is to install from the GitHub CRAN mirror.

library(remotes)
install_github("cran/foobarbaz")

7. There is no Windows/OS X/Linux binary

It may not have a Windows binary due to requiring additional software that CRAN does not have. Additionally, some packages are available only via the sources for some or all platforms. In this case, there may be a version in the CRAN (extras) repository (see setRepositories above).

If the package requires compiling code (e.g. C, C++, FORTRAN) then on Windows install Rtools or on OS X install the developer tools accompanying XCode, and install the source version of the package via:

install.packages("foobarbaz", type = "source")

# Or equivalently, for Bioconductor packages:
source("http://bioconductor.org/biocLite.R")
biocLite("foobarbaz", type = "source")

On CRAN, you can tell if you'll need special tools to build the package from source by looking at the NeedsCompilation flag in the description.


8. The package is on GitHub/Bitbucket/Gitorious

It may have a repository on GitHub/Bitbucket/Gitorious. These packages require the remotes package to install.

library(remotes)
install_github("packageauthor/foobarbaz")
install_bitbucket("packageauthor/foobarbaz")
install_gitorious("packageauthor/foobarbaz")

(As with installr, you may need to install.packages("remotes") first.)


9. There is no source version of the package

Although the binary version of your package is available, the source version is not. You can turn off this check by setting

options(install.packages.check.source = "no")

as described in this SO answer by imanuelc and the Details section of ?install.packages.


10. The package is in a non-standard repository

Your package is in a non-standard repository (e.g. Rbbg). Assuming that it is reasonably compliant with CRAN standards, you can still download it using install.packages; you just have to specify the repository URL.

install.packages("Rbbg", repos = "http://r.findata.org")

RHIPE on the other hand isn't in a CRAN-like repository and has its own installation instructions.

Upgrade R in Ubuntu xenial

What you have it pretty good. I would make it

a) use a file, say cran.list inside of /etc/apt/sources.list.d/

b) use https://, ie I have deb https://cloud.r-project.org/bin/linux/ubuntu zesty/ (and that actually points to the same CDN servers as what you have)

c) run apt-get update and then check via apt-cache policy r-base-core

It should show both the newer (at CRAN) and older (from Ubuntu):

edd@bud:~$ apt-cache policy r-base-core
r-base-core:
Installed: 3.4.3-1zesty0
Candidate: 3.4.3-1zesty0
Version table:
*** 3.4.3-1zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
100 /var/lib/dpkg/status
3.4.2-2zesty 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.2-1zesty1 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.1-2zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.1-1zesty0 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.4.0-1zesty 500
500 https://cloud.r-project.org/bin/linux/ubuntu zesty/ Packages
3.3.2-1 500
500 http://us.archive.ubuntu.com/ubuntu zesty/universe amd64 Packages
edd@bud:~$

The three stars show that that is the installed version.

d) Now when you see the desired version available, install the usual way via apt-get install r-base-core. You should get the highest version as expected.

How to reinstall the latest cmake version?

Following the comments made on how to Install the latest CMake version and to post the answer for this question:

Ans:

This depends with Ubuntu OS version currently installed on your PC or Mac. If you have the following Ubuntu OS version then you have this CMake installed or that you could install and reinstall with "sudo apt-get install cmake". Even if you uninstall your version and try to reinstall later version.

Ubuntu 16.04 ships with cmake-3.5.1
Ubuntu 17.10 ships with cmake-3.9.1
Ubuntu 18.04 ships with cmake-3.10.2
Ubuntu 20.04 ships with cmake-3.16.3
Ubuntu 21.04 ships with cmake-3.18.4

Now if you have Ubuntu 16.04 installed and you want cmake-3.10, there is OS problem since you can only install and reinstalled cmake-3.5.1. To get cmake-3.10 or any other version, you have to download and install the package from https://packages.ubuntu.com/. Once you find the latest version of cmake .targz files, you have to build it yourself from the command line.

Warning in install.packages : package ‘rattle’ is not available (for R version 3.4.4)

rattle requires R version 3.5.0 or higher.

Update R to the latest version, then you'll be able to install it.

Could not find a version that satisfies the requirement package

This approach (having all dependencies in a directory and not downloading from an index) only works when the directory contains all packages. The directory should therefore contain all dependencies but also all packages that those dependencies depend on (e.g., six, pytz etc).

You should therefore manually include these in requirements.txt (so that the first step downloads them explicitly) or you should install all packages using PyPI and then pip freeze > requirements.txt to store the list of all packages needed.



Related Topics



Leave a reply



Submit