参考dancer-docs/setup enviornment
1. 换源(中科大ustc/清华)
替换Ubuntu软件源:一般情况下,将/etc/apt/sources.list
文件中Ubuntu默认的源地址http://archive.ubuntu.com/
替换为http://mirrors.ustc.edu.cn
即可。
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
如果你在安装时选择的语言不是英语,默认的源地址通常不是
http://archive.ubuntu.com/
, 而是http://<country-code>.archive.ubuntu.com/ubuntu/
,如http://cn.archive.ubuntu.com/ubuntu/
,此时只需将上面的命令进行相应的替换即可,即sudo sed -i 's/cn.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
。
【而后感觉不太好用,换成了清华源
第一步:备份源文件
cd /etc/apt/
然后会显示下面的源文件sources.list
输入命令
sudo cp sources.list sources.list.bak
就是将sources.list备份到sources.list.bak
第二步:替换源文件
清华大学源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
sudo gedit sources.list
打开文件,将里面的代码替换成上面的代码即可
第三步:更新源
sudo apt-get update 更新源
sudo apt-get upgrade 更新软件
原文链接:https://blog.csdn.net/dty306034831/article/details/79188808
2.更新并安装依赖包
sudo apt-key update
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get -y autoremove --allow-unauthenticated
sudo apt-get install --install-recommends linux-generic-hwe-16.04 xserver-xorg-hwe-16.04
sudo apt-get install -y \
build-essential openssh-server wireless-tools git psmisc locales \
wget zsh htop vim curl cmake ccache clang autojump \
xclip xsel supervisor
sudo apt-get install -y \
libavcodec-dev libswscale-dev libx264-dev libprotobuf-dev protobuf-compiler \
python3-dev python3-pip python-dev python-pip \
libzmq3-dev libzmqpp-dev libgflags-dev qt5-default libgstreamer1.0-dev \
libjpeg-turbo8-dev gstreamer1.0-plugins-* libgstreamer-plugins-bad1.0-dev \
libeigen3-dev libqt5qml5 qtdeclarative5-dev
install -y \的时候报错了
就先跳过了1551
3.安装neovim
:
sudo add-apt-repository -y ppa:neovim-ppa/stable
sudo find /etc/apt/sources.list.d/ -type f -name "*.list" -exec sed -i.bak -r 's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 http\2://launchpad.proxy.ustclug.org#ig' {} \;
sudo apt-get update
sudo apt-get install neovim
4.安装zsh和插件
参考链接: https://blog.csdn.net/lxn9492878lbl/article/details/80795413
https://blog.csdn.net/qq_14824885/article/details/81098091
0 国内gitee安装方法
oh-my-zsh国内镜像安装和更新方法_繁星、晚风的博客-CSDN博客_ohmyzsh 国内镜像
1、 安装zsh
sudo apt-get install zsh
2、安装 oh my zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
关于oh my zsh可以看如下的链接:https://ohmyz.sh/community.html
当然也可以通过
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
3、配置文件
3.1创建配置文件
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
3.2设置zsh为默认的shell
chsh -s /bin/zsh
此时重新启动Ubuntu即可享受新的终端。打开后没有提示界面,有的话可以不理,直接q退出。
4、主题更换
主题当然很重要啦
主题参考官网 :https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
sudo vim ~/.zshrc
# 找到ZSH_THEME="robbyrussell",修改为:ZSH_THEME="ys";
source ~/.zshrc
主题推荐:ys/eastwood/robbyrussell/af-magic【使用的af-magic】
(robbyrussell)(eastwood)
(ys)
(af-magic)
5、zsh-autosuggestions自动补全插件
zsh常用有zsh-autosuggestions和incr,此处安装zsh-autosuggestions补全比较顺手
下载该插件到.oh-my-zsh的插件目录
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
编辑.zshrc文件
找到plugins=(git)这一行,如果没有添加。更改为如下
plugins=(git zsh-autosuggestions)
- 重启命令行
5.(可选)替换Pypi源
mkdir -p $HOME/.pip
echo -e '[global]\nindex-url = https://mirrors.ustc.edu.cn/pypi/web/simple\nformat = columns' > $HOME/.pip/pip.conf
6.安装Python依赖:
sudo pip install -U pip neovim watchdog click tmuxp
sudo pip3 install -U pip neovim click tmuxp