---
title: 安装R-4.2.0
description: 1. 下载R语言源码包。
url: "https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kylin_kunpeng_bioconductorappreci8r_1140_02_0006.html"
---

# 安装R-4.2.0

#### 操作步骤

1. 下载R语言源码包。

```
cd
/path/to/Appreci8r
wget https://cran.r-project.org/src/base/R-4/R-4.2.0.tar.gz
```


2. 解压安装。

```
tar xvf R-4.2.0.tar.gz
cd R-4.2.0
yum install libXt-devel libX11-devel readline-devel
./configure --prefix=
/path/to/Appreci8r/R_install
make
make install
```


3. 加载环境变量。

```
exp
ort PATH=
/path/to/Appreci8r/R_install/bin
:$PATH
exp
ort LD_LIBRARY_PATH=
/path/to/APPRECI8R/R_install/lib/R/lib
:$LD_LIBRARY_PATH
```


4. （未配置镜像源时可选）添加R语言的镜像源。

```
vim
~
/.Rprofile
```


5. 添加以下内容。

```
optio
ns("repos"= c(CRAN="http://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
optio
ns(BioC_mirror="http://mirrors.tuna.tsinghua.edu.cn/bioconductor/")
```
