ubuntu16 04初始化配置及深度學習環境搭建

2021-08-27 13:55:02 字數 3100 閱讀 4434

$ cd /etc/apt/

$ cp sources.list sources.list.backup #製作備份

$ sudo vim sources.list # 修改源列表

刪除所有內容並更換為(以ubuntu14為例)

# 預設注釋了原始碼映象以提高 apt update 速度,如有需要可自行取消注釋

deb trusty main restricted universe multiverse

# deb-src trusty main restricted universe multiverse

deb trusty-updates main restricted universe multiverse

# deb-src trusty-updates main restricted universe multiverse

deb trusty-backports main restricted universe multiverse

# deb-src trusty-backports main restricted universe multiverse

deb trusty-security main restricted universe multiverse

# deb-src trusty-security main restricted universe multiverse

# 預發布軟體源,不建議啟用

# deb trusty-proposed main restricted universe multiverse

# deb-src trusty-proposed main restricted universe multiverse

$ gedit ~/.bashrc
在末尾新增

ps1='$\[\033[01;35;01m\]\u\[\033[00;00;01m\]@\[\033[01;35;01m\]\h\[\033[00;31;01m\]:\[\033[00;00;01m\]\w \[\033[01;32;01m\]\$ \[\033[01;01;01m\]'
$ sudo

apt-get

install vim

$ git clone 

$ cp vim-monokai/monokai.vim /usr/share/vim/vim80/colors/ # vim**決定於vim版本

$ vim ~/.vimrc # 修改個人配置檔案
set encoding=utf-8

set fileencoding=utf-8

set fileencodings=ucs-bom,utf-8,chinese,cp936

set guifont=consolas:h15

language messages zh_cn.utf-8

set lines=45 columns=100

set number # 顯示行號

set autoindent #自動縮排

set smartindent #智慧型縮排

set tabstop=4 #設定tab長度為4個空格

set autochdir

set shiftwidth=4

set foldmethod=manual

syntax enable #開啟語法檢測

colorscheme monokai #主題配色

set nocompatible

set nobackup

$ sudo

apt-get

install

git

$ git config --global user.name "your name"

$ git config --global user.email "[email protected]"

$ ssh-keygen -t rsa -c "[email protected]"

$ cat ~/.ssh/id_rsa.pub 複製公鑰新增到github

$ sudo add-apt-repository ppa:mystic-mirage/pycharm #新增源

$ sudo apt update

$ sudo apt install pycharm-professional #專業版

$ sudo apt install pycharm-community #社群版

$ sudo add-apt-repository ppa:webupd8team/sublime-text-3 

$ sudo

apt-get update

$ sudo

apt-get

install sublime-text-installer

$ sudo

apt-get

install ipython3

$ sudo

apt-get

install python3-pip

$ pip3 install numpy scipy matplotlib pandas scikit-learn imutils
$ pip3 install opencv-python
$ pip3 install tensorflow
$ pip3 install theano
$ pip3 install keras
$ conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

ubuntu16 04配置網絡卡

第一步 檢視網絡卡資訊 輸入ifconfig命令檢視網絡卡資訊,下圖紅圈處就是網絡卡名稱。第二步 配置網絡卡檔案 注意 不同的linux系統,網絡卡配置檔案是不同的,這裡ubuntu的網絡卡配置檔案是 etc network inte ces。輸入下面命令進行編輯網絡卡檔案 sudo vi etc ...

ubuntu16 04配置網絡卡

第一步 檢視網絡卡資訊 輸入ifconfig命令檢視網絡卡資訊,下圖紅圈處就是網絡卡名稱。注意 不同的linux系統,網絡卡配置檔案是不同的,這裡ubuntu的網絡卡配置檔案是 etc network inte ces。輸入下面命令進行編輯網絡卡檔案 sudo vi etc network inte...

Ubuntu16 04配置網絡卡

配置網絡卡檔案 注意 不同的linux系統,網絡卡配置檔案是不同的,這裡ubuntu的網絡卡配置檔案是 etc network inte ces。輸入下面命令進行編輯網絡卡檔案 sudo vi etc network inte ces 預設的檔案內容如下 auto lo iface lo inet ...