给实验室服务器更新debian,R和Rstudio

1. 服务器debian升级

由于最新版rstudio server需要debian10,而服务器是debian9。因此给服务器升级一下

lsb_release -a
# -------
# No LSB modules are available.
# Distributor ID:    Debian
# Description:    Debian GNU/Linux 9.9 (stretch)
# Release:    9.9
# Codename:    stretch
# -------
uname -mrs
# -------
# Linux 4.9.0-9-amd64 x86_64
# -------
cat /etc/os-release #查看服务器版本,可以看到是debian9
# -------
# PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
# NAME="Debian GNU/Linux"
# VERSION_ID="9"
# VERSION="9 (stretch)"
# ID=debian
# HOME_URL="https://www.debian.org/"
# SUPPORT_URL="https://www.debian.org/support"
# BUG_REPORT_URL="https://bugs.debian.org/
# -------
apt-get update && apt-get upgrade #更新系统到最新
cd /etc/apt
cp sources.list sources.list.bak3.debian9.20230107 #备份一下实验室之前的sources.list
# 因为在更新的时候有很多抱错,所以我更新了实验室服务器的sources.list到阿里云的源
apt-get update && apt-get upgrade # 很成功,没有报错
sudo apt full-upgrade
# ---------
# # 实验室服务器的源,保存为sources.list.bak3.debian9.20230107.labused
# deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
# deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
# deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
# deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free
# deb https://mirrors.tongji.edu.cn/CRAN/bin/linux/debian stretch-cran35/
# deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu stretch stable
# deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian stretch stable
# # 阿里云的debian9源,链接是https://developer.aliyun.com/mirror/
# deb https://mirrors.aliyun.com/debian/ stretch main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ stretch main non-free contrib
# deb https://mirrors.aliyun.com/debian-security stretch/updates main
# deb-src https://mirrors.aliyun.com/debian-security stretch/updates main
# deb https://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
# # 阿里云的debian10源
# deb https://mirrors.aliyun.com/debian/ buster main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ buster main non-free contrib
# deb https://mirrors.aliyun.com/debian-security buster/updates main
# deb-src https://mirrors.aliyun.com/debian-security buster/updates main
# deb https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
# deb https://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
# deb-src https://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
# ---------
lsb_release -a
# -------------
# No LSB modules are available.
# Distributor ID:    Debian
# Description:    Debian GNU/Linux 9.13 (stretch)
# Release:    9.13
# Codename:    stretch
# -------------
apt --purge autoremove
reboot
cp sources.list.bak4.debian10.20230107 sources.list
apt-get update && apt-get upgrade -y#再次更新系统
sudo apt full-upgrade #升级系统q
sudo reboot
sudo apt --purge autoremove
# 更新完毕 看看效果
lsb_release -a
# No LSB modules are available.
# Distributor ID:    Debian
# Description:    Debian GNU/Linux 10 (buster)
# Release:    10
# Codename:    buster
uname -mrs
# Linux 4.19.0-23-amd64 x86_64 #比我云服务器版本都新了
cat /etc/os-release
# PRETTY_NAME="Debian GNU/Linux 10 (buster)"
# NAME="Debian GNU/Linux"
# VERSION_ID="10"
# VERSION="10 (buster)"
# VERSION_CODENAME=buster
# ID=debian
# HOME_URL="https://www.debian.org/"
# SUPPORT_URL="https://www.debian.org/support"
# BUG_REPORT_URL="https://bugs.debian.org/"

2. 安装rstudio-server

sudo apt-get install r-base
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.12.0-353-amd64.deb
sudo gdebi rstudio-server-2022.12.0-353-amd64.deb
# 安装成功,简直太丝滑了
# 现在可以通过http://10.10.81.248:8787/访问
# 我在我自己的账户下用conda建了一个R环境,然后修改以下文件
vim /etc/rstudio/rserver.conf
# -----
# # Server Configuration File
# rsession-which-r=/home/caigui/miniconda3/envs/R/bin/R
# rsession-ld-library-path=/home/caigui/miniconda3/envs/R/lib
# -----
# 这样rstuido登陆就可以用这个环境下的R包了
# 这样就可以使用服务器上的rstuio server处理单细胞数据了
# ps:经过实践,使用我自己的用户登陆的时候可以正常安装R包,其它用户就没试了,有问题再说吧。

results matching ""

    No results matching ""