優化Ubuntu
1. 更換 apt 源
echo '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-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports 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' >/etc/apt/sources.list
2. 系統更新
sudo apt update
sudo apt upgrade
3. 安裝搜狗輸入法
3.1 安裝 fcitx 輸入框架
sudo apt install fcitx
3.2 下載 linux 版本搜狗輸入法
wget http://cdn2.ime.sogou.com/dl/index/1524572264/sogoupinyin_2.2.0.0108_amd64.deb
3.3 安裝
sudo dpkg -i sogoupinyin_2.2.0.0108_amd64.deb
如果出現依賴包的問題執行
sudo apt --fix-broken install
3.4 進入設定
- 根據提示安裝輸入法
- 將輸入框架改為 fcitx
點選Apply System-Wide
後將使用者登出,如果登出沒有效果那麼就重啟吧。
- 登陸後右上角出現小鍵盤
點選Configure Current Input Method
,進入Input Method
介面,選擇加號新增搜狗輸入法。
4. 軟體解除安裝、安裝
4.1 解除安裝 libreOffice 安裝 wps
sudo apt remove libreoffice-common
4.2 安裝 wps
wget https://wdl1.cache.wps.cn/wps/download/ep/Linux2019/8722/wps-office_11.1.0.8722_amd64.deb
sudo dpkg -i wps-office_11.1.0.8722_amd64.deb
4.3 解除安裝 firefox 安裝 chrome
sudp apt remove firefox
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
5. vim 配置
5.1 下載 vim
sudo apt install vim
5.2 編輯 vim 配置檔案
sudo vim /etc/vim/vimrc
新增如下程式碼:
配置還在更新
6. 美化 ubuntu
6.1 安裝 unity-tweak-tool
sudo apt intall unity-tweak-tool
6.2 下載 flatabulous 主題
# 按照官方教程使用 add-apt-repository 方法定位不到 flatabulous 包,改用手動安裝
sudo add-apt-repository ppa://noobslab/themes
sudo apt update
sudo apt install flatabulous-theme
wget https://github.com/anmoljagetia/Flatabulous/archive/master.zip
mkdir .theme
mv ./master.zip ~/.theme
unzip master.zip
6.3 下載 flat icons
sudo add-apt-repository ppa://noobslab/icons
sudo apt update
sudo apt install ultra-flat-icons
6.4 開啟 unity-tweak-tool
再開啟 unity-tweak-tool 時出現:
Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
Error: schema com.canonical.notify-osd not installed
解決辦法如下:
sudo apt install notify-osd
sudo apt install overlay-scrollbar
圖示配置好了,但是主題因為 GTK 的原因沒有成功,記錄如下:
6.5 下載字型
在 monaco-font 庫中下載 zip 包
unzip monaco-font-master.zip
sudo ./install-font-ubuntu.sh https://github.com/todylu/monaco.ttf/blob/master/monaco.ttf?raw=true
下載完成後使用unity-tweak-tool
設定字型。
7. 終端
這個才是重頭戲。
因為很多 linux 預設的終端 shell 都是 bash,但是不太好用,所以改為 zsh。
7.1 下載 zsh
sudo apt install zsh
7.2 下載 oh-my-zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
7.3 修改預設 shell
sudo usermod --shell /bin/zsh $USERNAME
修改後記得 log_out 重新登入使用者。
7.4 修改皮膚
vim ~/.zshrc
# 修改皮膚
ZSH_THEME="robbyrussell"
8. 外掛安裝
8.1 autojump
- 下載
sudo apt install aotujump
- 配置 autojump
vim /usr/share/doc/autojump/README.Debian
echo '. /usr/share/autojump/autojump.sh' >> ~/.zshrc
source ~/.zshrc
8.2 zsh-syntax-highlighting
- 安裝
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- 配置
plugins=(zsh-syntax-highlighting)
source ~/.zshrc
8.3 zsh-autosuggestions
- 安裝
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
- 配置
plugins=(zsh-autosuggestions)
source ~/.zshrc
8.4 git-open
- 下載
git clone https://github.com/paulirish/git-open.git $ZSH_CUSTOM/plugins/git-open
- 配置
plugins=(git-open)
source ~/.zshrc
8.5 修改檢視 history 格式
HIST_STAMPS="yyyy-mm-dd"