程序员

Ubuntu 16.04 搭建 RStudio Server +

2018-08-24  本文已影响0人  自在如风_cd16

1.安装Ubuntu 16.04 操作系统

2.Ubuntu切换国内源

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse
$ sudo apt-get update
$ sudo apt-get upgrade

3.下载并安装r-base-core

4.下载并安装RStudio-Server

https://download2.rstudio.org/rstudio-server-1.1.456-amd64.deb

5.查看和切换RStudio-Server状态

$ sudo rstudio-server status
$ sudo rstudio-server start
$ sudo rstudio-server stop

本地浏览器:localhost:8787
其它浏览器:服务器ip:8787
账户密码为Ubuntu的登录账户密码

6.下载和安装Anaconda

https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
本人用的是:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh
$ bash ./Ana.........sh

7.配置Jupyter Notebook Server

$ jupyter notebook password
$ mkdir ~/.jupyter
$ jupyter notebook password
$ jupyter notebook --generate-config
$ gedit ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip='*'
c.NotebookApp.notebook_dir = '/home/username/jupyter_nb'(此处自定义即可)
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
$ jupyter notebook

本地浏览器:localhost:8888
其它浏览器:服务器ip:8888
密码为前面设置的密码

8.pip切换国内源(永久)

$ sudo mkdir ~/.pip
$ sudo touch ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

9.配置ssh远程登录

$ sudo apt-get install openssh-server
$ sudo service ssh restart

10.NVIDIA驱动安装 (我的显卡是NVIDIA Geforce GTX960)

http://www.nvidia.cn/Download/index.aspx?lang=cn
$ sudo gedit /etc/modprobe.d/blacklist.conf
#在最后一行添加:blacklist nouveau
$ sudo update-initramfs -u
$ sudo reboot
#按Ctrl+Alt+F1进入命令行界面(这里要等一会儿)
$ lsmod | grep nouveau
$ sudo /etc/init.d/lightdm stop
$ cd 安装脚本放置的目录
$ sudo chmod a+x NVIDIA-...run(给安装脚本赋予可执行权限)
$ sudo ./NVIDIA-...run(安装)
$ sudo /etc/init.d/lightdm start
$ sudo nvidia-smi
$ sudo reboot

11.安装cuda 9.0

https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
$ cd 安装包放置的目录
$ sudo dpkg -i cuda...deb
$ sudo apt-key add /var/cuda-repo-9-0-local/7fa2af80.pub
$ sudo apt-get update
$ sudo apt-get install cuda
$ sudo gedit /etc/profile
#尾部输入
#export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
#如果是64位系统,输入: 
#export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
#如果是32位系统,输入: 
#export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
$ sudo reboot

12.安装cuDNN 7.0.5

https://developer.nvidia.com/cudnn
$ cd 安装包放置的目录
$ sudo dpkg -i libcudnn7_7.0.5-1...deb
$ sudo reboot

13.安装TensorFlow-GPU版本

$ pip install tensorflow-gpu
上一篇下一篇

猜你喜欢

热点阅读