Debian maintains R in its main package repository alongside the rest of the operating system. That integration suits statistical analysis, report generation, and noninteractive data jobs that need to follow the host's normal APT update policy.
The r-base metapackage installs the core interpreter and Debian's collection of recommended R packages. This route favors a distribution-tested runtime over receiving a newer upstream release before it reaches the active Debian repository.
APT should report matching installed and candidate versions after the package transaction. A separate Rscript expression without user or site startup files confirms that the noninteractive runtime used by scheduled jobs and CI systems can start successfully.
Related: Install an R package from CRAN
Steps to install R on Debian:
- Refresh the Debian package metadata.
$ sudo apt update
- Install the R metapackage from the Debian repository.
$ sudo apt install --yes r-base
The r-base metapackage installs r-base-core and the recommended R packages maintained for the active Debian release.
- Inspect the installed and candidate r-base versions in APT.
$ apt-cache policy r-base r-base: Installed: 4.5.0-3 Candidate: 4.5.0-3 Version table: *** 4.5.0-3 500 500 http://deb.debian.org/debian trixie/main arm64 Packages 100 /var/lib/dpkg/statusThe version and architecture can differ on another supported Debian release. The installed and candidate fields should match after installation.
- Evaluate an R expression without user or site startup files.
$ Rscript --vanilla -e 'cat(R.version.string, "\n")' R version 4.5.0 (2025-04-11)
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.