安装Deepin V20.2系统
最近因为学习需要,换了一台电脑,完了又是系统的安装。总之,docker环境折腾我了一个多星期。最后完美搞定。
............ shunzi@thinkpad
.';;;;;. .,;,. OS: Deepin 20.2
.,;;;;;;;. ';;;;;;;. Kernel: x86_64 Linux 5.10.18-amd64-desktop
.;::::::::' .,::;;,''''',. Uptime: 2h 3m
,'.:::::::: .;;'. '; Packages: 2107
;' 'cccccc, ,' :: '.. .: Shell: bash
,, :ccccc. ;: .c, '' :. ,; Resolution: 3840x1080
.l. cllll' ., .lc :; .l' l. DE: Deepin 20.2
.c :lllc ;cl: .l' .ll. :' WM: KWin
.l 'looc. . ,o: 'oo' c, Icon Theme: bloom-classic
.o. .:ool::coc' .ooo' o. CPU: Intel Core i9-10885H @ 16x 5.3GHz
:: ..... .;dddo ;c GPU: GeForce RTX 2070 Super with Max-Q Design
l:... .';lddddo. ,o RAM: 3808MiB / 63947MiB
lxxxxxdoolllodxxxxxxxxxc :l
,dxxxxxxxxxxxxxxxxxxl. 'o,
,dkkkkkkkkkkkkko;. .;o;
.;okkkkkdl;. .,cl:.
.,:cccccccc:,.
首先更新系统
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
卸载nano编辑器
sudo apt-get remove nano
修改sudo 无密码
sudo visudo
修改:%sudo ALL=(ALL:ALL) ALL
为:%sudo ALL=(ALL:ALL) NOPASSWD:ALL
修改挂载目录
- 卸载自动挂载分区
umount /dev/nvme0n1p5 umount /dev/nvme0n1p6
- 挂载分区
sudo mkdir /data sudo mkdir /work sudo mount /dev/nvme0n1p5 /data sudo mount /dev/nvme0n1p6 /work
配置开机自动挂载fstab
sudo vi /etc/fstab #在文件后面追加下面的代码 # /dev/nvme0n1p5 /dev/nvme0n1p5 /data ntfs defaults,nls=utf8,uid=1000,gid=1000,dmask=022,fmask=022,windows_names 0 0 # /dev/nvme0n1p6 /dev/nvme0n1p6 /work ntfs defaults,nls=utf8,uid=1000,gid=1000,dmask=022,fmask=022,windows_names 0 0
- 最终的结果就是下面的,完美~
shunzi@thinkpad:~$ df -h 文件系统 容量 已用 可用 已用% 挂载点 udev 32G 4.0K 32G 1% /dev tmpfs 6.3G 3.3M 6.3G 1% /run /dev/nvme0n1p1 49G 17G 30G 36% / tmpfs 32G 156M 32G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 32G 0 32G 0% /sys/fs/cgroup /dev/nvme0n1p6 166G 58G 108G 36% /work /dev/nvme0n1p5 600G 154G 447G 26% /data /dev/nvme0n1p4 98G 5.3G 88G 6% /opt /dev/nvme0n1p2 300M 6.6M 293M 3% /boot/efi tmpfs 6.3G 60K 6.3G 1% /run/user/1000
安装常用软件及设置
安装qv2ray图形化软件
# Install some prerequisites needed by adding GPG public keys $ sudo apt-get install gnupg ca-certificates curl # Import our GPG key. Notice the hyphen at the end of line. $ curl -sSL https://qv2ray.net/debian/pubkey.gpg | sudo apt-key add - # Add the our official APT repository: $ echo "deb [arch=amd64] https://qv2ray.net/debian/ stable main" | sudo tee /etc/apt/sources.list.d/qv2ray.list # To update the APT index: $ sudo apt-get update # You can install Qv2ray from APT now: $ sudo apt-get install qv2ray
- 命令行代理设置
export all_proxy=socks5://127.0.0.1:1080
常用软件在系统应用商店下载即可:
Google浏览器,微信,VLC,TeamViewer,Wine游戏助手,MEGA,Visual Studio Code,VirtualBox,DBeaver,为知笔记,Telegram,Sublime Text,qBittorrent,网易云音乐,WPS Office,Typora
- 其中大部分软件都是安装系统的时候自带装好了,其他的自己看吧。这些是我必装的。
- 其中安利一个软件
MEGA
,全平台同步软件,以前我用百度云同步盘,现在已经不更新了,而且那个没有linux客户端,MEGA是全平台的,免费的有30G的空间,而且免费的也不限速,比百度云良心多了,注册地址:https://mega.nz/#sync/aff=2-Xkbx_8qxo - 新增了wine游戏助手软件,替代收费的crossover,用来玩WOW。还是免费的。
- 修改文件管理区被VSCode接管问题
gio mime inode/directory dde-file-manager.desktop
- 添加java环境变量
sudo tar -zxvf jdk-8u191-linux-x64.tar.gz -C /opt/ #添加环境变量到~/.bashrc export JAVA_HOME=/opt/jdk1.8.191 export CLASSPATH=.:$JAVA_HOME/bin.tools.jar export PATH=$JAVA_HOME/bin:$PATH
- 修改系统Downloads目录
#修改 ~/.config/user-dirs.dirs XDG_DESKTOP_DIR="$HOME/Desktop" XDG_DOWNLOAD_DIR="$HOME/Downloads" # > /work/Downloads XDG_TEMPLATES_DIR="$HOME/" XDG_PUBLICSHARE_DIR="$HOME/" XDG_DOCUMENTS_DIR="$HOME/Documents" XDG_MUSIC_DIR="$HOME/Music" XDG_PICTURES_DIR="$HOME/Pictures" XDG_VIDEOS_DIR="$HOME/Videos" #执行:xdg-user-dirs-update更新
- 安装mysql client
pip install mysqlclient #报错(OSError: mysql_config not found) #一般情况是系统没有安装libmysqld-dev sudo apt install libmysqld-dev pip install mysqlclient
- 安装系统监控插件
wget https://gitee.com/q77190858/dde-sys-monitor-plugin/raw/master/bin/libsys_monitor.so && \ sudo mv libsys_monitor.so /usr/lib/dde-dock/plugins/ && \ pkill dde-dock
安装SublimeText3
#软件库安装的时版本2的,不能输入中文 #Install the GPG key: wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - #Ensure apt is set up to work with https sources: sudo apt-get install apt-transport-https #Select the channel to use: #Stable echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list #Update apt sources and install Sublime Text sudo apt-get update sudo apt-get install sublime-text
- megasync安装
#下载软件 wget https://mega.nz/linux/MEGAsync/Debian_10.0/amd64/megasync_4.3.8-1.1_amd64.deb sudo apt-get install ./megasync_4.3.8-1.1_amd64.deb #megasync for deepin v20 bug处理 #Then run these commands: sudo sed -i -r '/^TryExec/d;s|^(Exec=).*$|\1env QT_SCALE_FACTOR=1 megasync|g' /usr/share/applications/megasync.desktop cp /usr/share/applications/megasync.desktop ~/.config/autostart/
- 配置pip国内镜像源
cat ~/.pip/pip.conf [global] index-url = https://mirrors.aliyun.com/pypi/simple/
- 配置docker国内镜像源
#touch /etc/docker/daemon.json data-root路径最好是ext格式的,我挂载的ntfs磁盘时一直报错,搞了好久解决不了,最后改成/opt目录就好使了 { "data-root": "/opt/docker", "registry-mirrors" : [ "http://ovfftd6p.mirror.aliyuncs.com", "http://registry.docker-cn.com", "http://docker.mirrors.ustc.edu.cn" ], "insecure-registries" : [ "registry.docker-cn.com", "docker.mirrors.ustc.edu.cn" ], "storage-driver": "overlay2", "storage-opts": [ "overlay2.override_kernel_check=true" ], "live-restore" : false }
- 开机自启动脚本
#!/bin/bash #rc.local config file created by use cd /data/v2ray/ && nohup ./v2ray & cd /data/Project/ && nohup jupyter notebook & cd /data/frp_client/ && nohup ./frpc -c ./frpc.ini & exit 0
安装pyenv环境
- 安装依赖软件
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git libedit-dev
- 安装pyenv环境
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
- 配置环境变量
export PATH="/home/shunzi/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
搭建Jupyter Notebook环境
- 安装python软件
pyenv install 3.8.9 pyenv virtualenv 3.8.9 jupyter
配置jupyter环境
cd /data/Project #给目录/data/Project添加虚拟环境 pyenv local jupyter #安装python库 pip install jupyter numpy pandas openpyxl xlsxwriter xlrd matplotlib seaborn SQLAlchemy mysql-connector #设置配置文件 jupyter notebook --generate-config c.NotebookApp.ip='*' c.NotebookApp.password = u'sha1:a280cdbdfdef:389e854a8101a5c0f852559c3d243bd7ff83a73f' c.NotebookApp.open_browser = False c.NotebookApp.port =8888 c.NotebookApp.notebook_dir = '/data/Project' #c.NotebookApp.allow_remote_access = True #c.NotebookApp.ip = '0.0.0.0'
安装显卡驱动
- 安装显卡驱动主要是配合wine游戏助手打魔兽世界
# 下载mgpu-prime软件包,该软件包用于提供双显卡支持,用于带集显+独显的笔记本。如果你是台式机,也可以不下载安装,但是安装了也没有副作用。 wget https://file.winegame.net/packages/deepin/mgpu/mgpu-prime_0.2.0_amd64.deb # 安装驱动程序。如果你是台式机,没下载mgpu-prime_0.2.0_amd64.deb,就把命令结尾的./mgpu-prime_0.2.0_amd64.deb删掉。 sudo apt install -y nvidia-driver nvidia-smi nvidia-settings nvidia-vulkan-icd vulkan-utils nvidia-driver-libs:i386 libnvidia-ml1:i386 libxnvctrl0:i386 ./mgpu-prime_0.2.0_amd64.deb # 更新启动文件 sudo update-initramfs -k all -u
安装docker环境
- 卸载旧版docker
sudo apt-get remove docker docker-engine docker.io containerd runc
- 安装依赖
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
- 添加官方GPG秘钥
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
验证秘钥
# 验证安装:9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88通过搜索指纹的最后8个字符,验证您现在拥有带指纹的密钥。 sudo apt-key fingerprint 0EBFCD88 # 输出这个结果表示添加成功 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [ unknown] Docker Release (CE deb)
sub rsa4096 2017-02-22 [S] - 添加官方软件源
echo "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian buster stable" | sudo tee /etc/apt/sources.list.d/docker.list
- 安装最新版docker
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io sudo usermod -aG docker $USER sudo systemctl start docker sudo systemctl enable docker.service
- 附带安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose docker-compose --version
配置软件快捷启动
- dbeaver.desktop
[Desktop Entry] Categories=IDE;Development Comment=Enterprise Database Manager. Exec=/data/dbeaver/dbeaver GenericName=UniversaL Database Manager Icon=/data/dbeaver/dbeaver.png Keywords=Database;SQL;IDE;JDBC;ODBC;MySQL;PostgreSQL;Oracle;DB2;MariaDB MimeType=application/sql Name=DBeaver Enterprise Path=/data/dbeaver/ StartupNotify=true StartupWMClass=DBeaverEE Terminal=false Type=Application Version=1.0 WM_CLASS=DBeaverEE X-Deepin-Vendor=user-custom
- qv2ray.desktop
[Desktop Entry] Version=0.10.2 Name=Qv2ray Comment=A V2ray GUI Exec=/usr/bin/qv2ray Icon=/work/Downloads/qv2ray.png Terminal=false Type=Application Categories=Network
- megasync.desktop
[Desktop Entry] Type=Application Version=1.0 GenericName=File Synchronizer Name=MEGAsync Comment=Easy automated syncing between your computers and your MEGA cloud drive. Exec=env QT_SCALE_FACTOR=1 megasync Icon=mega Terminal=false Categories=Network;System; StartupNotify=false X-GNOME-Autostart-Delay=60
- bilihelper.desktop
[Desktop Entry] Name=Bilibili-helper Name[zh_CN]=Bilibili弹幕库 Icon=/data/bilibili-helper/icon1.png Exec=/data/bilibili-helper/弹幕库 StartupNotify=false Terminal=false Type=Application Categories=Application
内网穿透配置
- ngrok方式
#ngrok python版的 网上某个大拿写的没有维护了,存在内存泄露,弃用了 cat ngrok.config { "server": { "host": "ngrok.xxxx.me", "port": 8001, "bufsize": 1024 }, "client": [ { "protocol": "http", "hostname": "jupyter.xxxx.me", "subdomain": "", "rport": 6888, "lhost": "127.0.0.1", "lport": 8888 }, { "protocol": "tcp", "hostname": "", "subdomain": "", "rport": 1022, "lhost": "127.0.0.1", "lport": 22 } ] }
frp方式(推荐这个,配置简单好用)
#服务端启动配置 [root@hk frp_server]# cat frps.ini [common] bind_port = 8001 vhost_http_port=6888 #客户端配置 cat frpc.ini [common] server_addr = ngrok.xxxx.me server_port = 8001 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 1022 [web] type = http local_port = 8888 custom_domains = jupyter.xxxx.me
Git操作
#git 常用操作
git branch -a --查询本地仓库列表
git checkout -b master dev --复制master版本到dev版本 并切换到dev版本
git checkout dev -- 切换本地分支
git merge --合并指定分支到当前分支
#远程操作
git remote -v --查看远程版本库信息
git remote add --添加远程版本库
git remote remove --删除远程版本库
git fetch --从远程库获取代码
git pull --下载代码及快速合并
git push --上传代码及快速合并
#配置 ssh-key
ssh-keygen.exe -t rsa -C "5030699@qq.com"
cat ~/.ssh/id_rsa.pub
#复制到GithubSessionKey
#配置本地全局信息
git config --global user.name "shunzi"
git config --global user.email "5030699@qq.com"
#更新合并某个代码案例
git branch dev_update
git checkout dev
git pull
git checkout dev_update
git merge dev
git merge old_master --合并配置信息
pip install -r requirements.txt
python manager.py makemigration
python manager.py migrate
结束语
这个应该是系统安装的最终版吧。反正折腾死我了。其中最大的两点就是最近刚想到的系统磁盘划分规划。 1TSSD 我给划分了几个核心目录,/根目录给了50G,/opt给了100G,这个目录重装系统的时候不需要重启。/data是ntfs格式的,存我的日常使用数据,不需要重新安装。/work也是ntfs格式,存一些临时及下载的数据。 总之deepin v20.2安装完美,蓝牙,wifi全部搞定。以后估计不会再折腾系统了吧。
继续阅读
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏