Ubuntu 16.04 裝機指南
1. 製作引導盤
藉助 ultroISO 製作啓動盤很簡單,這裏就不在贅述,可以參考 製作Ubuntu16.04系統安裝的U盤(附資源).
2. 系統分區
關於分區的說法很多,而且基本都還是針對很老舊的配置的,下面說說我自己的做法,經過多次測試暫時沒有發現什麼不妥。我有一個固態和一個機械硬盤,機械硬盤直接全部劃分爲主分區。
- EFI 2G primary Beginning of this space EFI
- swarp 32G primary Beginning of this space ext4 swap
- boot 固態硬盤的剩餘空間 Beginning of this space ext4 /boot
- / 整個機械硬盤 Beginning of this space ext4 /
3. 將 python3 設置爲默認項
ubuntu16.04 自帶 python2.7 和 python3.5, 但是默認項是2.7。把 python3.5 設置爲默認的方式如下:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
4. 安裝中文輸入法
參考 ubuntu 16.04中文輸入法安裝
注意命令不要直接 copy, 原文中的命令之間少了空格,無法識別。
5. 更換系統源
參考 Ubuntu 更換國內源
需要注意的是,版本要對應,16.04不要弄成了18.04了。
更換之後更新源和軟件。
更新源
sudo apt-get update
更新軟件
sudo apt-get upgrade
6. 安裝 vim
sudo apt-get install vim
參考 ubuntu16.04下vim的安裝與配置 進行 vim 設置。
7. 安裝 VS Code
安裝參考 Ubuntu 16.04 安裝VSCode
另外如果你需要用 vscode 寫 markdown 的話,可能需要用到 paste image 這個插件,而這個插件需要安裝 xclip。
sudo apt-get install xclip
8. 安裝 git
sudo apt-get install git
9. 安裝 CMake-gui
sudo apt-get install cmake-qt-gui
10. 安裝 chrome 瀏覽器
chrome 下載地址 chrome-64bit。
安裝參考 在Ubuntu16.04上安裝Chrome瀏覽器
安裝完成之後直接在 terminal 輸入如下命令就可以啓動 chrome 瀏覽器了。
google-chrome
11. 安裝顯卡驅動
這個不是必須,根據需要選擇,我因爲需要用 Cuda 和 Cudnn, 這裏必須要安裝 N 卡的驅動。
安裝顯卡參考 Ubuntu16.04安裝NVIDIA驅動、實現GPU加速
需要注意的是,上面的參考文章中是先執行下面的 stop,再進入命令行的。這裏建議先進入命令行(Ctrl+Alt+F1),再執行 stop。
sudo service lightdm stop
在安裝的時候有一些選項,可能不同的驅動版本會略有不同,我下載的是最新的版本 430.50,選項大致如下:
- the distribution-provided pre-install script failed! Are you sure you want to continue?
選擇 yes 繼續。 - Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?
選擇 No 繼續。 - Nvidia’s 32-bit compatibility libraries? 選擇 No 繼續。
Would you like to run the nvidia-xconfigutility to automatically update your x configuration so that the NVIDIA x driver will be used when you restart x? Any pre-existing x confile will be backed up.
選擇 Yes 繼續
12. CUDA9.0
安裝可以參考 Ubuntu16.04 + cuda9.0 + cudnn_v7 + tensorflow-gpu + opencv3.4.2
需要注意的是安裝的過程中不要安裝驅動,因爲前面我們已經自己安裝了驅動。
安裝過程大致和 cuda8 類似。
Do you accept the previously read EULA?accept/decline/quit: accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?(y)es/(n)o/(q)uit: n
Install the CUDA 8.0 Toolkit?(y)es/(n)o/(q)uit: y
Enter Toolkit Location[ default is /usr/local/cuda-8.0 ]:
Do you want to install a symbolic link at /usr/local/cuda?(y)es/(n)o/(q)uit: y
Install the CUDA 8.0 Samples?(y)es/(n)o/(q)uit: y
Enter CUDA Samples Location[ default is /home/textminer ]:
Installing the CUDA Toolkit in /usr/local/cuda-8.0 …
Installing the CUDA Samples in /home/textminer …
Copying samples to /home/textminer/NVIDIA_CUDA-8.0_Samples now…
Finished copying samples.
13. CUDNN7.0
這個安裝比較簡單,沒有什麼風險,參考 Ubuntu16.04 + cuda9.0 + cudnn_v7 + tensorflow-gpu + opencv3.4.2。