Ubuntu20.04 下 rstudio 安装教程(附安装包下载)

Posted Z.Q.Feng

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu20.04 下 rstudio 安装教程(附安装包下载)相关的知识,希望对你有一定的参考价值。

文章目录

前言

一、下载 deb 包

二、引入 rstudio 安装密匙

1. 获取公钥

2. 验证构建签名

三、安装 rstudio

四、检验安装


前言

本以为 Ubuntu 下 rstudio 安装也只是简单的安装包安装过程,但是在安装过程中碰了不少壁,最后也是成功安装了,分享一波安装经验。


一、下载 deb 包

rstudio 官网下载地址如下:

https://www.rstudio.com/products/rstudio/download/#download

没得科学上网工具根本进不去,所以这里我提供了 amd64 的 deb 包下载

https://download.csdn.net/download/weixin_46584887/20305582

下载完成后,进入下载目录。


二、引入 rstudio 安装密匙

1. 获取公钥

创建 keys.txt 文件,复制下面完整密钥公钥到文本文件内并保存。

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBFnnkaUBEADF8Ue0CLeO08aGjx4O2BPbZAIEXeazLlD6JgdnUGqUrK+D2TxU
aQ/y1Xz2MCChcyrgVE9Sbmlpp+Jk+lviGsFdcqy25IwfR+bD+o5me5awlK5f1llQ
8Z46BPPePYpRgmljKegUROmvVjgmOZs7wmhnWk0xdOVqzbWE51Hg3EgPW5zIWFeW
DVKjHG1p4BR8BkaCv2TUYFGRec+AHr13BB5FWTpaDLqmD4loKHqWzabFClpOQn1Q
XLmHpNhclab33pFAxqqZ82PsszowcKK8LdTgRjdnovwSRufcQC+3xkz6NBel4gzp
idUQ60BmSG7GCNPL6TyX2S3j9QgmyzeebrHDMZwGMIGP3kn0NAhl/1OJYv/rki/R
/zQqxinzmcTTa5d8IjAUc4YiAvzsQbxA5sTK8AWA3chf/mJFuv2kbWKBukiGfBvs
sRkUz3TPioO4tZY6nsrojsfO/d7L8/0voCrL5GHlZLWn6zCx7eOiK6LfNE8qNgsX
hbqwPuuC/S7scNNUsDo3tZIn6do/USTAMs9rlWsj6R1YskmF9QBF/K9j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
BFdrMB2yRGEOJfyqbfJ8iu4Iht0bfs7PHC9IIlQGcFvhYoecrHmkeQ8vBgXYZ/44
tv1MoqlGLyMHBevQohqxRpnKcIaoRtB5vGNHLNijn/A0/0RAmLK9Fk0+Dz5UGGbh
1qEbSWFw6ve9p5sOvYDLN0K+eQGIOaRg8GbWg7PYD9fTjg+eK4GRzb4QcOKi5mCB
WW03NUDE37fsJ6WWAOcm6Xn9jJjSHJx8A6TVqZbYTVSbUMM+l5J5iwbbI4iuthbC
KnsgPc6R5xg/55Im4NU=
=WoWq
-----END PGP PUBLIC KEY BLOCK-----

导入并信任 RStudio 的公共代码签名密钥。打开终端,使用 gpg 从我们刚才的 keys.txt 文件中获取公钥:

gpg --import keys.txt

输出如下:

/home/zq/Downloads> gpg --import keys.txt
gpg: key 3F32EE77E331692F: "RStudio, Inc. (code signing) <info@rstudio.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
/home/zq/Downloads>  

2. 验证构建签名

在基于 Debian 的 Linux 系统上,使用 dpkg-sig 命令来验证签名。若尚未安装 dpkg-sig 软件包,可以使用以下命令安装:

sudo apt-get install dpkg-sig

接着执行以下命令: 

dpkg-sig --verify rstudio-1.4.1717-amd64.deb

输出如下:

/home/zq/Downloads> dpkg-sig --verify rstudio-1.4.1717-amd64.deb
Processing rstudio-1.4.1717-amd64.deb...
GOODSIG _gpgbuilder FE8564CFF1AB93F1728645193F32EE77E331692F 1621900781
/home/zq/Downloads>  


三、安装 rstudio

注意:这里不能使用常用的 dpkg 安装方法,例如我的电脑出现了如下报错:

/home/zq/Downloads> sudo dpkg -i rstudio-1.4.1717-amd64.deb
[sudo] password for zq: 
Selecting previously unselected package rstudio.
(Reading database ... 531460 files and directories currently installed.)
Preparing to unpack rstudio-1.4.1717-amd64.deb ...
Unpacking rstudio (1.4.1717) ...
dpkg: dependency problems prevent configuration of rstudio:
 rstudio depends on libclang-dev; however:
  Package libclang-dev is not installed.

dpkg: error processing package rstudio (--install):
 dependency problems - leaving unconfigured
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu2) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (1.15-1) ...
Errors were encountered while processing:
 rstudio
/home/zq/Downloads

在缺少插件的情况下,dpkg 仍然给我安装了 rstudio,虽然 rstudio 安装后能正常使用,但是却导致我的 apt 工具直接瘫痪了,所以这里我们使用另一个安装包工具,打开终端,安装 gdebi。

sudo apt-get install gdebi

接着通过 deb 包安装 rstudio :

sudo gdebi rstudio-1.4.1717-amd64.deb

出现如下报错:

/home/zq/Downloads> sudo gdebi rstudio-1.4.1717-amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading state information... Done
This package is uninstallable
Cannot install 'libclang-dev'

/home/zq/Downloads>

参考此篇文章,安装 libclang-dev 插件:

Cannot install ‘libclang-dev‘--Ubuntu20.04 安装 libclang-dev 插件

继续执行安装命令,安装成功!

/home/zq/Downloads> sudo gdebi rstudio-1.4.1717-amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading state information... Done
Requires the installation of the following packages: libclang-10-dev libclang-dev

RStudio
        RStudio is a set of integrated tools designed to help you be more productive with R. It includes a console, syntax-highlighting editor that supports direct code execution, as well as tools for plotting, history, and workspace management.
Do you want to install the software package? [y/N]:y
/usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1
         c = findall("[[(](\\S+)/\\S+[])]", msg)[0].lower()
Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libclang-10-dev amd64 1:10.0.0-4ubuntu1 [19.4 MB]

/home/zq/Downloads>


四、检验安装

打开终端,键入 rstudio,

 软件正常打开,安装成功!


有帮助可以点赞哦,谢谢大家支持~

以上是关于Ubuntu20.04 下 rstudio 安装教程(附安装包下载)的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu20.04下安装 R 及 CRAN 软件包(命令行操作)

Ubuntu20.04下安装 R 及 CRAN 软件包(命令行操作)

真·手把手教你配置ubuntu20.04中cuda+cudnn

Cannot install ‘libclang-dev‘--Ubuntu20.04 安装 libclang-dev 插件

Cannot install ‘libclang-dev‘--Ubuntu20.04 安装 libclang-dev 插件

[RK356x] [Firefly-Linux] 一节课间时间教你把Ubuntu 20.04系统语言设置为中文