参考dancer-docs/setup enviornment

1. 换源(中科大ustc/清华)

替换Ubuntu软件源:一般情况下,将/etc/apt/sources.list文件中Ubuntu默认的源地址http://archive.ubuntu.com/替换为http://mirrors.ustc.edu.cn即可。

  1. 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

第二步:替换源文件

清华大学源

  1. # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
  2. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
  3. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
  4. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
  5. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
  6. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  7. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  8. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
  9. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
  10. # 预发布软件源,不建议启用
  11. # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
  12. # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

sudo gedit sources.list打开文件,将里面的代码替换成上面的代码即可

第三步:更新源

  1. sudo apt-get update 更新源
  2. sudo apt-get upgrade 更新软件

原文链接:https://blog.csdn.net/dty306034831/article/details/79188808

2.更新并安装依赖包

  1. sudo apt-key update
  2. sudo apt-get update
  3. sudo apt-get upgrade -y
  4. sudo apt-get -y autoremove --allow-unauthenticated
  5. sudo apt-get install --install-recommends linux-generic-hwe-16.04 xserver-xorg-hwe-16.04
  6. sudo apt-get install -y \
  7. build-essential openssh-server wireless-tools git psmisc locales \
  8. wget zsh htop vim curl cmake ccache clang autojump \
  9. xclip xsel supervisor
  10. sudo apt-get install -y \
  11. libavcodec-dev libswscale-dev libx264-dev libprotobuf-dev protobuf-compiler \
  12. python3-dev python3-pip python-dev python-pip \
  13. libzmq3-dev libzmqpp-dev libgflags-dev qt5-default libgstreamer1.0-dev \
  14. libjpeg-turbo8-dev gstreamer1.0-plugins-* libgstreamer-plugins-bad1.0-dev \
  15. libeigen3-dev libqt5qml5 qtdeclarative5-dev

install -y \的时候报错了

就先跳过了1551

3.安装neovim:

  1. sudo add-apt-repository -y ppa:neovim-ppa/stable
  2. 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' {} \;
  3. sudo apt-get update
  4. 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

  1. sudo vim ~/.zshrc
  2. # 找到ZSH_THEME="robbyrussell",修改为:ZSH_THEME="ys";
  3. source ~/.zshrc

主题推荐:ys/eastwood/robbyrussell/af-magic【使用的af-magic】

配环境%26安装依赖 - 图1(robbyrussell)配环境%26安装依赖 - 图2(eastwood)

配环境%26安装依赖 - 图3(ys)

配环境%26安装依赖 - 图4(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源

  1. mkdir -p $HOME/.pip
  2. echo -e '[global]\nindex-url = https://mirrors.ustc.edu.cn/pypi/web/simple\nformat = columns' > $HOME/.pip/pip.conf

6.安装Python依赖:

  1. sudo pip install -U pip neovim watchdog click tmuxp
  2. sudo pip3 install -U pip neovim click tmuxp

7.安装Ros Kinetic

下节