---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://catboost.ai/docs/en/installation/r-installation-local-copy-installation-windows.md
  - href: en/installation/r-installation-local-copy-installation-windows.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

<!-- source: en/installation/r-installation-local-copy-installation.md -->
# Install R package from a local source repository copy

<!-- source: en/_includes/work_src/reusage-installation/r__recommended-installation-method__note.md -->
{% note info %}

It is strongly recommended to [install the released version](https://catboost.ai/docs/en/installation/r-installation-binary-installation.md). Try it if other installation methods result in errors.

{% endnote %}
<!-- endsource: en/_includes/work_src/reusage-installation/r__recommended-installation-method__note.md -->


<!-- source: en/_includes/work_src/reusage-code-examples/nvidia-driver-reqs.md -->
Training or inference on CUDA-enabled GPUs requires NVIDIA Driver of version 450.80.02 or higher.
<!-- endsource: en/_includes/work_src/reusage-code-examples/nvidia-driver-reqs.md -->


To install the R package from a local copy of the CatBoost repository:
1. Set up build environment

    <!-- source: en/_includes/work_src/reusage-installation/setup-build-environment-alternatives.md -->
    {% note warning %}

    <!-- source: en/_includes/work_src/reusage-installation/ya-make-to-cmake-switch.md -->
    CatBoost uses [CMake](https://cmake.org/)-based build process since [this commit](https://github.com/catboost/catboost/commit/c5c642ca0b8e093336d0229ac4b14c78db3915bb). Previously `Ya Make` (Yandex's build system) had been used.
    <!-- endsource: en/_includes/work_src/reusage-installation/ya-make-to-cmake-switch.md -->

    Select the appropriate build environment setup below accordingly.

    {% endnote %}

      - [For CMake](https://catboost.ai/docs/en/installation/build-environment-setup-for-cmake.md)
      - [For Ya Make](https://catboost.ai/docs/en/installation/build-environment-setup-for-ya-make.md)
    <!-- endsource: en/_includes/work_src/reusage-installation/setup-build-environment-alternatives.md -->

1. Clone the repository:
    ```
    git clone https://github.com/catboost/catboost.git
    ```

1. Open the `catboost/catboost/R-package` directory from the local copy of the CatBoost repository.
1. <!-- source: en/_includes/work_src/reusage-installation/using-the-following-code.md -->
   Run the following commands:
   <!-- endsource: en/_includes/work_src/reusage-installation/using-the-following-code.md -->

    ```
    install.packages('devtools')
    devtools::build()
    devtools::install()
    ```

<!-- source: en/_includes/work_src/reusage-installation/r__troubleshooting.md -->
#### Troubleshooting {#troubleshooting}

{% cut "Installation error" %}

If you use script for installation, try to add the `repos` parameter to the `install.packages('devtools')` command.
Select any repository from the [list](https://cran.r-project.org/mirrors.html).

Example: `install.packages("devtools", repos="http://cran.us.r-project.org")`.

{% endcut %}

{% cut "ERROR: some hard-coded temporary paths could not be fixed" %}

This can be mitigated by adding "--no-staged-install" option to `INSTALL_opts` parameter of `remotes::install_url` call

{% endcut %}
<!-- endsource: en/_includes/work_src/reusage-installation/r__troubleshooting.md -->
<!-- endsource: en/installation/r-installation-local-copy-installation.md -->