{ "hash": "2f46ad4471fb3eb57c3b8b2e50186f31", "result": { "engine": "knitr", "markdown": "---\ntitle: Debian Packages of R Software\ndate: \"2024-11-01\"\nformat:\n html:\n css: R-CRAN.css\n mathjax: null\n theme: united\n toc: true\n---\n\n\n\n\n\n# General information\n\n[Packages for the base R system](https://packages.debian.org/search?searchon=sourcenames&keywords=r-base&exact=true)\nhave been part of the Debian distribution\n[since 1997](https://metadata.ftp-master.debian.org/changelogs//main/r/r-base/r-base_4.4.2-1_changelog),\nthanks to Douglas Bates, and are diligently maintained by Dirk\nEddelbuettel since 2001. R, as well as many add-on packages (from CRAN and\nother repositories) are available via the regular Debian distribution\nmechanisms. Hence, running\n\n```sh\napt search \"^r-.*\" | sort\n```\n\nin a shell should get you started with a list of available packages. In the\nfollowing, commands that need write access to system areas are prepended by\n`sudo`, assuming that you do not have root privileges.\n\n## Debian sid (unstable) and experimental\n\nThe latest stable version of\n[R](https://packages.debian.org/sid/r-base)\nand many\n[R packages from CRAN](https://packages.debian.org/search?keywords=r-cran&searchon=names&suite=unstable)\nand the\n[Bioconductor project](https://packages.debian.org/search?keywords=r-bioc&searchon=names&suite=unstable)\nare usually available in the [official Debian sid repositories](https://wiki.debian.org/DebianUnstable).\nDuring the so-called freeze period before new releases, the latest versions of\nR and some of these extension packages may only be available in\n[experimental](https://wiki.debian.org/DebianExperimental).\n\nFor the other distributions (testing during the freeze, stable, and older\nreleases), [backports](#backports-on-cran) of the latest R version and some\n[related packages](#supported-packages) are provided here.\n\n## Installation\n\nWith an appropriate entry in `/etc/apt/sources.list` (see below for Debian\nbranches other than sid/unstable or experimental), the newest R release\nincluding recommended packages can be installed using a command sequence like\n\n```sh\nsudo apt update\nsudo apt install r-base r-base-dev\n```\n\nIf you get a warning about a missing public key, chances are that you have\nenabled one of the repositories described further below. Please refer to the\n[section on secure apt](#secure-apt) for getting the key for secure retrieval\nof the packages.\n\nYou only need `r-base-dev` if you want to compile R packages\nyourself or other software depending on R (see section below on\nadministration and maintenance). Be aware that you may also have\nto install build dependencies (typically -dev packages containing\nheaders). The list\n[r-sig-debian](https://stat.ethz.ch/mailman/listinfo/r-sig-debian)\nis a good place to ask if you run into problems.\n\n## Administration and Maintenance\n\nThe R packages part of `r-base` and `r-recommended` are installed\ninto the directory `/usr/lib/R/library`. The other R packages available as\nprecompiled Debian packages `r-cran-*` and `r-bioc-*` are installed into\n`/usr/lib/R/site-library`.\n\nThese can be updated using usual Debian package maintenance tools like apt\nor aptitude.\n\nThe command\n\n```sh\napt rdepends r-base-core\n```\n\nshows all packages that depend on `r-base-core`. This comprises a large number\nof contributed packages from CRAN and other repositories.\n\nIf you want to install R packages not provided as Debian packages, or if you\nwant to use newer versions, you need to build them from source which requires\nthe development package `r-base-dev` that can be installed by\n\n```sh\nsudo apt install r-base-dev\n```\n\nThis pulls in the basic requirements for compiling R packages. R packages may\nthen be installed by the local user/admin from the CRAN source packages,\ntypically from inside R using the\n\n```r\ninstall.packages()\n```\n\nfunction or using\n\n```sh\nR CMD INSTALL\n```\n\nfrom a shell. If you have proper write\npermissions in `/usr/local/lib/R/site-library/`, and you have not\nset `R_LIBS_USER` manually, they will be installed there. Otherwise,\nyou will be asked if a directory in your home directory should be created for\nthese packages. A routine update of such locally compiled packages can be done\nwithin R using\n\n```r\nupdate.packages(.libPaths()[1])\n```\n\nwhich will update the packages in the first part of your library path. You can\nhave a look at the components of this path using the R command\n\n```r\n.libPaths()\n```\n\nIf you would like to update R packages that have been installed via the Debian\npackage management system which are installed somewhere under `/usr/lib/`, I\nwould recommend to do this the Debian way using the source packages from Debian\nunstable.\n\n\n## Pathways to R Packages\n\nIn order to find packages, R looks at the variables `R_LIBS_USER` and\n`R_LIBS_SITE`. On Debian and Ubuntu, `R_LIBS_USER` is set in `/etc/R/Renviron`\nto\n\n```\nR_LIBS_USER=${R_LIBS_USER-'~/R/$platform-library/4.0'}\n```\n\nwhere `$platform` is something like `'x86_64-pc-linux-gnu'` and depending on\nthe version of R installed. You can override this in `~/.Renviron`.\n`R_LIBS_SITE` is set in `/etc/R/Renviron` to\n\n```\nR_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'}\n```\n\nThis means that packages installed from within R take precedence over the ones\ninstalled via the Debian package management system if you happen to have two\nversions installed at the same time.\n\n# Backports on CRAN\n\nAs R and related packages are currently not part of the official Debian backports repositories\nlike `bullseye-backports` (please contact\n[r-sig-debian](https://stat.ethz.ch/mailman/listinfo/r-sig-debian)\nif you would like to change this),\nthe R versions in released or frozen Debian releases get out of date.\nTherefore, updates of a subset of these R related packages are provided here for such Debian releases.\n\n## Supported packages\n\nThe packages recommended by the R core team (`r-recommended`) are updated in\nthe Debian repositories on CRAN upon each new release of R (at least for\nthe main architectures amd64 and i386). These packages are:\n\n```\nr-cran-boot\nr-cran-class\nr-cran-cluster\nr-cran-codetools\nr-cran-foreign\nr-cran-kernsmooth\nr-cran-lattice\nr-cran-mass\nr-cran-matrix\nr-cran-mgcv\nr-cran-nlme\nr-cran-nnet\nr-cran-rpart\nr-cran-spatial\nr-cran-survival\n```\n\nBackports of the following packages are also supplied and kept up to date in\nthe same manner:\n\n```\nlittler\nrpy2 (bookworm only)\nrkward\n```\nAny help is welcome in case you would like to see additional packages here.\n\n## Secure apt\n\nThe key ID used to sign current Debian package repositories on CRAN has ID\n`0xB8F25A8A73EACF41`, key fingerprint\n`95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7` and user\nID `Johannes Ranke `.\n\nYou can fetch the key from the keyserver run by the Ubuntu project:\n\n```sh\ngpg --keyserver keyserver.ubuntu.com \\\n --recv-key '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7'\n```\n\nIn case you are behind a firewall blocking port 11371, you can specify a proxy\nserver by adding `--keyserver-options http-proxy=` in the above command.\n\nThen you export it and write it to the directory where apt will trust it\n(overwriting any pre-existing file with the same name, if existing):\n\n```sh\ngpg --armor --export '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7' | \\\n sudo tee /etc/apt/trusted.gpg.d/cran_debian_key.asc\n```\n\n## Supported branches\n\n### Debian bookworm (stable)\n\nDebian bookworm has been released on 10th of June 2023. If you use bookworm and\nwould like to use R 4.4.2, you can use the following repository.\n\n```sh\ndeb http://cloud.r-project.org/bin/linux/debian bookworm-cran40/\n```\n\nNote that R 4.3.x has bumped the Graphics API, so graphics packages like\nsvglite, tikzDevice, rgl, rvg, ggplot2 or vdiffr (embedding\nsvglite) will need to be reinstalled. This also affects the graphics device\nsupplied by rkward. If you don't you will get an error message\n\n```\nGraphics API version mismatch\n```\n\n### Debian bullseye (oldstable)\n\nDebian bullseye has been released with R 4.0.4. If you want to upgrade to R\n4.4.2 on bullseye, you can use the following repository.\n\n```sh\ndeb http://cloud.r-project.org/bin/linux/debian bullseye-cran40/\n```\n\nNote that R 4.1.x, R 4.2.x and R 4.3.x have bumped the Graphics API, so graphics\npackages like svglite, tikzDevice, rgl, rvg, ggplot2 or vdiffr (embedding\nsvglite) will need to be reinstalled. This also affects the graphics device\nsupplied by rkward. If you don't you will get an error message\n\n```\nGraphics API version mismatch\n```\n\n### Debian buster (oldoldstable)\n\nIn October 2024, the `buster-backports` repository was removed from the Debian\narchive. Consequently, the backports on CRAN for Debian buster are discontinued.\n\nFor a backport of R 4.4.1 to buster, please add\n\n```sh\ndeb http://cloud.r-project.org/bin/linux/debian buster-cran40/\n```\n\nto the file `/etc/apt/sources.list` on your computer. Note that security\nupdates for buster have been discontinued as of June 30th, 2022 by the\nDebian project. LTS support for buster will cease 30th of June 2024. Visit\n[this link](https://www.debian.org/releases/buster) for more information.\n\nDue to the API change (R 4.0.x and 4.1.0 provide r-api-4), installing R 4.x.x\nwill remove all Debian packages dependent on r-api-35, with the exception of\nthe ones provided here. Also, you will need to update R packages that you have\nobtained directly from CRAN or Bioconductor.\n\nPlease refer to the note above on the Graphics API version bump.\n\nIn addition, if you had a large number of locally installed packages before the\nchange to r-api-4, updating them using e.g. the R command given below may take\nsome time, also depending on the number of CPU threads you run in parallel:\n\n```r\nupdate.packages(lib.loc=\"/usr/local/lib/R/site-library\", ask = FALSE,\n checkBuilt = TRUE, Ncpus = 16)\n```\nIn my case, using 16 parallel threads as specified in the command above, the\ndownloading took about eight minutes and the first round of installation with\nheavy CPU load took another 12 minutes. Then it stopped mentioning that I\nneeded to manually reinstall testthat, which I did using `install.packages()`.\nThis may be necessary due to a circular dependency, as Dirk pointed out in\nhis upgrade report on his\n[blog](http://dirk.eddelbuettel.com/blog/2020/04/26/#026_upgrade_to_R400).\nAfter I did that, I ran the update command again and it took another six\nminutes until it successfully completed.\n\nIf you have Bioconductor packages installed as well, you need to switch to\nthe current version using the commands listed\n[here](https://bioconductor.org/packages/3.11/bioc/html/Biobase.html).\n\nA backport of R 3.6.3 to buster is also available, which does not require\nreinstalling extension packages.\n\n```sh\ndeb http://cloud.r-project.org/bin/linux/debian buster-cran35/\n```\n\n### Debian stretch\n\nFor a historic backport of R 3.6.3 to stretch, please add\n\n```sh\ndeb http://cloud.r-project.org/bin/linux/debian stretch-cran35/\n```\n\nto the file `/etc/apt/sources.list` on your computer. Note that\nsecurity support for stretch has been discontinued in 2020, and\nLong Term Support (TLS) has ended at the end of June 2022. Visit\n[this link](https://www.debian.org/releases/stretch) for more\ninformation.\n\nPlease note that R packages from the Debian stretch distribution\nare not compatible with R 3.5.x, as it provides r-api-3.5, while\nthe stretch packages depend on r-api-3.\n\nAlso, local packages installed before the update to R 3.5.0 will not work\ncorrectly if they use compiled code.\n\nR packages you have compiled locally can be updated within R using\n\n```r\nupdate.packages(lib.loc=\"/usr/local/lib/R/site-library\", ask=FALSE, checkBuilt=TRUE)\n```\n\nThere is also an old repository containing R 3.4.4 that still has arm64 and\narmhf binaries:\n\n```sh\ndeb http://cloud.r-project.org/bin/linux/debian stretch-cran34/\n```\n\n## Supported Platforms\n\nThere are i386 and amd64 binaries for all Debian releases. Since R 3.1.0,\nR is fully functional on arm and armel binaries for jessie and wheezy were\nprovided here up to R 3.4.2. Since R 3.4.2 and up to R 3.4.4, binaries for\narmhf and arm64 were provided for Debian stretch (with the exception of R 3.4.3\non arm64, see [this\nbug](https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17363)).\n\nFor other architectures and releases, you can use the source packages from one\nof these repositories\n\n```sh\ndeb-src cloud.r-project.org/bin/linux/debian bookworm-cran40/\ndeb-src cloud.r-project.org/bin/linux/debian bullseye-cran40/\ndeb-src cloud.r-project.org/bin/linux/debian buster-cran40/\ndeb-src cloud.r-project.org/bin/linux/debian buster-cran35/\ndeb-src cloud.r-project.org/bin/linux/debian stretch-cran35/\ndeb-src cloud.r-project.org/bin/linux/debian jessie-cran35/\n```\n\nto compile binary Debian packages.\n\n## Reporting Problems\n\nThe best place to report problems with these packages or ask R\nquestions specific to Debian is the\n[r-sig-debian](https://stat.ethz.ch/mailman/listinfo/r-sig-debian)\nmailing list. See\n\n\n\nfor more information.\n\n## Backporting Debian packages for CRAN\n\nAnyone interested in building Debian packages (e.g. for an unsupported release,\nanother architecture or an old R version) can have a look at the build scripts\nused by the current maintainer. These can be inspected at\n\n\n\nor cloned from the git repository\n\n```sh\ngit clone https://cgit.jrwb.de/r-backports\n```\n\nThe scripts contain some small changes needed to compile the original Debian\npackages on the supported release.\n\n# Installing R-devel or a release branch from svn\n\nThe following notes are an attempt to merge the hints given in a\nthread on r-sig-debian started end of March 2015, and the tips given\nat . I have not used this a lot\nand I assume you have some experience in building software on unix systems.\nNo warranties, your mileage may vary.\n\nFirst, make sure you have a source repository in your `/etc/apt/sources/list`, like\n\n```sh\ndeb-src http://deb.debian.org/debian/ unstable main\n```\n\nin order to make it easier to get the build dependencies. Then update\nyour list of available packages and get the build dependencies\n\n```sh\nsudo apt update\nsudo apt build-dep r-base\n```\n\nTo install the build dependencies. The following commands do not need root\nprivileges, and are safer to run as a normal user.\n\nI keep all sources managed by subversion under `~/svn`, so I do\n\n```sh\nexport RTOP=~/svn/R\n```\n\nPlease adapt to your needs. The location of the source code for the base R system\nis conveniently defined as en environment variable by\n\n```sh\nexport REPOS=https://svn.r-project.org/R\n```\n\n## R-devel\n\nWe change to our RTOP directory and check out the latest revision of R-devel\n\n```sh\ncd $RTOP\nsvn co $REPOS/trunk r-devel/source\nmkdir $RTOP/r-devel/build\n```\n\nThe second time around we only need to\n\n```sh\ncd $RTOP/r-devel/source\nsvn up\n```\n\nThen we need to get the sources of the recommended packages\n\n```sh\ncd $RTOP/r-devel/source/tools\n./rsync-recommended\n```\n\nWe build in the separate directory created above, in order not to pollute the\nsource code\n\n```sh\ncd $RTOP/r-devel/build\n../source/configure\n```\n\nThere are a lot of configure options you might want to use, for example\nyou will probably want `--with-blas=\"-lopenblas\"` to get more performant\nlinear algebra operations. This depends on `libopenblas-dev` to be installed,\nwhich, per default, will pull `libopenblas-pthread-dev` on Debian bullseye.\n\nWe are not using the install target here, so we do\nnot set `--prefix`. This is to avoid conflicts with the Debian packages of\nreleased versions of R. The next step builds the sources.\n\n```sh\nmake\nmake check\nmake pdf\nmake info\n```\n\nOf course doing checks and making pdf and info documentation is optional. Then\nwe use links to make R-devel and Rscript-devel available (obviously supposes\nwrite permission on /usr/local/bin).\n\n```sh\ncd /usr/local/bin\nln -s /$RTOP/r-devel/build/bin/R R-devel\nln -s /$RTOP/r-devel/build/bin/Rscript Rscript-devel\n```\n\nThis will make the commands `R-devel` and `Rscript-devel` available.\nNote that the only entry on `.libPaths()` is `$RTOP/r-devel/build/library`,\nso this is where packages will be installed.\n\n## R-patched\n\nAfter the release of a version R-x.y.0, the so-called release branch is\nused to introduce changes that meet the\n[development guidelines](http://developer.r-project.org/devel-guidelines.txt).\n\nWe can build such branches (aka R-patched) using the following scheme, which is\nadapted from the procedure given for R-devel, but without duplicating all comments.\n\nAs of November 2023, the release branch can be defined by\n\n```sh\nexport RPATCHED=branches/R-4-3-branch\n```\n\nR-patched can than be built and made available by\n\n```sh\ncd $RTOP\nsvn co $REPOS/$RPATCHED r-patched/source\nmkdir $RTOP/r-patched/build\ncd $RTOP/r-patched/source/tools\n./rsync-recommended\n```\n\nAgain, we build in the separate directory created above, in order not to pollute the\nsource code\n\n```sh\ncd $RTOP/r-patched/build\n../source/configure\nmake\nmake check\nmake pdf\nmake info\n```\n\nThen, as privileged user:\n\n```sh\ncd /usr/local/bin\nln -s /$RTOP/r-patched/build/bin/R R-patched\nln -s /$RTOP/r-patched/build/bin/Rscript Rscript-patched\n```\n\nThe builds can be updated by updating the sources from the repository, syncing\nthe latest versions of the recommended packages and rebuilding.\n\n# Debian R policy\n\nAn RFC on a first public draft of 'Debian R Policy' has been\n[posted to debian-devel in 2003](https://lists.debian.org/debian-devel/2003/12/msg02367.html).\n\n# Contributions\n\nThis document is maintained by Johannes Ranke . The\nDebian R packages are maintained by Dirk Eddelbuettel. The backported packages\npresent on CRAN are provided by Johannes Ranke. Thanks to Mathieu Basille for\nrestructuring the README in March 2015.\n", "supporting": [ "index_files" ], "filters": [ "rmarkdown/pagebreak.lua" ], "includes": {}, "engineDependencies": {}, "preserve": {}, "postProcess": true } }