深度学习ubuntu系统重装配置
前言
由于ubuntu系统经常因为各种原因出现问题,导致重装了好几次。遂记录重装系统后整个环境的安装配置过程,以免下次又得重装。(不定期更新)
基本软件安装
安装好系统后,需要安装一些常用的软件。下面罗列:
- Chrome浏览器
- 搜狗输入法
- 网易云
- wps
proxy配置
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module gconf2 gconf-service libappindicator1 python
#可选
sudo apt-get install libssl-dev
sudo apt-get install libsodium-dev
直接安装electron
将设置里的代理地址设为127.0.0.1,http/https端口为12333,sock为1080
安装cuda10.1和cudnn
参考
禁用Nouveau驱动
# 需要g++和gcc
sudo apt-get install gcc g++
sudo sh ./*.run
pip网络配置
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -U pip
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
在~/.config/pip/中出现pip.conf,编辑其为如下:
[global]
timeout=40
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
extra-index-url=https://pypi.python.org/simple
设置proxy
pip3 --proxy 127.0.0.1:12333 install
或者在.bashrc中添加
alias pip3="pip3 --proxy 127.0.0.1:12333"
安装nautilus-admin
sudo apt install nautilus-admin
nautilus -q
配置深度学习环境
pip3 install virtualenv
记得重启之后才生效
git代理设置
git config --global https.proxy http://127.0.0.1:12333
git config --global --unset https.proxy
搜狗输入法安装
有道词典安装
hexo配置
sudo npm install -g n
sudo n v12.14.1
强化学习环境配置
gym安装
pip3 install gym==0.12.5
pip3 install atari-py
pip3 install box2d-py
pip3 install pyglet==1.3.2
如果要玩box2d中的CarRacing,就一定要安装pyglet1.3.2版本的,别问,问就是BUG
jupyter lab安装
pip3 install jupyterlab
## 启动
jupyter lab
jupyter使用virtualenv
激活创建的虚拟环境,然后在此环境下
pip3 install ipykernel
python -m ipykernel install --user --name=[kernel名]
jupyter软件
参考
个人觉得挺好用,很方便,除了不能自动补全
Shell扩展
system-monitor
在应用商店搜索system-monitor安装,需要先安装依赖项,参考
Docker配置
sudo 权限设置
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo systemctl restart docker
sudo chmod a+rw /var/run/docker.sock
proxy设置
进入/etc/文件夹搜索docker.server,添加如下指令
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:8080/"
Environment="HTTPS_PROXY=http://proxy.example.com:8080/"
docker换源
编辑/etc/docker/daemon.json,没有就创一个
{
"registry-mirrors" : [
"http://ovfftd6p.mirror.aliyuncs.com",
"http://registry.docker-cn.com",
"http://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com"
],
"insecure-registries" : [
"registry.docker-cn.com",
"docker.mirrors.ustc.edu.cn"
],
"debug" : true,
"experimental" : true
}
安装Flatpak以访问更多应用程序
sudo apt install flatpak
sudo apt install gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
shell 插件
system-monitor
sudo apt-get install gir1.2-gtop-2.0 gir1.2-networkmanager-1.0 gir1.2-clutter-1.0