ubuntu18.04优化

Linux 系统用来用去还是发现ubuntu用的最舒服,毕竟用了从14.04 一直用到了18.04 。用了三年多了。下面就直接记录下。我这边优化系统的全部命令,方便下次装机使用。

更换源

重命名源

1
$ sudo mv /etc/apt/sources.list  /etc/apt/sources.list.mv

建立阿里源

1
$ sudo vi /etc/apt/sources.list

复制以下内容

1
2
3
4
5
6
7
8
9
10
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

更新源

1
$ sudo apt update && sudo apt upgrade

改目录名称

1
2
$ export LANG=en_US
$ xdg-user-dirs-gtk-update

下载git

1
$ apt install git

配置git

1
2
$ git config --global user.name "ziv" 
$ git config --global user.email "abc.ziv@hotmail.com"

配置SSH秘钥

1
2
$ ssh-keygen -t rsa -C "abc.ziv@hotmail.com"
$ cat ~/.ssh/id_rsa.pub

安装VSCode

1
2
$ wget https://vscode.cdn.azure.cn/stable/c7d83e57cd18f18026a8162d042843bda1bcf21f/code_1.35.1-1560350270_amd64.deb
$ sudo dpkg -i code_1.35.1-1560350270_amd64.deb

安装 搜狗拼音

1
2
$ wget http://cdn2.ime.sogou.com/dl/index/1524572264/sogoupinyin_2.2.0.0108_amd64.deb
$ sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb

安装搜狗拼音依赖

1
2
3
4
5
$ sudo apt install -f
$ locale
$ check-language-suppor
## 把出现的所有依赖都安装
$ sudo reboot

安装谷歌浏览器

1
2
$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo dpkg -i google-chrome-stable_current_amd64.deb

安装oh-my-zsh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ sudo apt-get install zsh
$ chsh -s /bin/zsh
$ sudo vi /etc/passwd
## 把第一行的/bin/bash改成/bin/zsh,这个是root用户的
## 把最后一行的/bin/bash改成/bin/zsh,这个应该是每台电脑的登录用户名+计算机名组成的。
$ sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
$ sudo reboot
# 查看主题
$ ls ~/.oh-my-zsh/themes
# 自动提示插件zsh-autosuggestions
$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
# 语法高亮zsh-syntax-highlighting使用以下命令安装
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 修改主题 配置插件
$ vi ~/.zshrc
plugins=(git zsh-syntax-highlighting zsh-autosuggestions)
ZSH_THEME="主题" 推荐:steeef ys
# 更新配置
$ source ~/.zshrc

安装shadowsocks-qt5

1
2
3
4
5
$ sudo add-apt-repository ppa:hzwhuang/ss-qt5
$ vi /etc/apt/sources.list.d/hzwhuang-ubuntu-ss-qt5-bionic.list
## bionic(18.04版本代号)改成xenial(16.04版本代号)
$ sudo apt update
$ sudo apt install shadowsocks-qt5

安装百度网盘

1
2
$ wget https://github.com/liuzhuoling2011/baidupcs-web/releases/download/3.6.7/BaiduPCS-Go-3.6.7-linux-amd64.zip
$ unzip BaiduPCS-Go-3.6.7-linux-amd64.zip

安装thunderbird邮箱

1
sudo apt install thunderbird

安装印象笔记

1
sudo apt install nixnote2 -y

安装flameshot截图工具

1
2
wget https://github.com/lupoDharkael/flameshot/releases/download/v0.6.0/flameshot_0.6.0_bionic_x86_64.deb
sudo dpkg -i flameshot_0.6.0_bionic_x86_64.deb

安装rememberthemilk

1
2
3
wget https://www.rememberthemilk.com/download/linux/debian/pool/main/r/rememberthemilk/rememberthemilk_1.1.13_amd64.deb
sudo dpkg -i rememberthemilk_1.1.13_amd64.deb
sudo apt install -f

WPS

1
2
wget https://wdl1.cache.wps.cn/wps/download/ep/Linux2019/8392/wps-office_11.1.0.8392_amd64.deb
sudo dpkg -i wps-office_11.1.0.8392_amd64.deb

Mailspring

Mailspring

1
2
wget https://updates.getmailspring.com/download?platform=linuxDeb
sudo dpkg -i mailspring-1.7.2-amd64.deb