title: "Ubuntu 20.04 配置" date: 2023-01-06 10:43:00+08:00 tags: ["Linux", "Ubuntu"] published: false license: true slug: ubuntu20-04-config cate: tech cover_image: "./images/ubuntu20-04-config.png" canonical_url: false
大概就是我重装了 n 遍 Ubuntu,终于在截止目前重装的倒数第二遍的时候脑瓜子突然灵光一闪,想起来把基本的一些配置全部记下,万一下次还要重装就不用再去一个个搜了。结果,没想到这个万一来的这么快:sob:,更让人难受的是当时这个文件就放在 Ubuntu 桌面上,但是 Ubuntu 已经完全进不去了,后面只好想办法从 windows 上面把文件搞出来
# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# sudo gedit /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# sudo apt
sudo unzip -d ~/.local/share/fonts JetBrainsMono.zip
sudo unzip -d ~/.local/share/fonts Noto_Sans_SC.zip
sudo fc-cache -f -v
Fclash simple Clash GUI
clashrup Simple CLI to manage your systemd clash.service
and config subscriptions on Linux.
手动
命令行运行 clash
替换 ~.config/clash/config.yaml
开机自启动
# /etc/systemd/system/clash.service
[Unit]
Description=Clash service
After=network.target
[Service]
Type=simple
User=jalen(用户名)
ExecStart=/home/jalen/app/clash(Clash 程序路径)
Restart=on-failure
[Install]
WantedBy=multi-user.target
# 重载服务
sudo systemctl daemon-reload
# 开机启动
sudo systemctl enable clash
# 启动服务
sudo systemctl start clash
# 查看服务状态
sudo systemctl status clash
set proxy
export http_proxy=http://127.0.0.1:7890
export https_proxy=https://127.0.0.1:7890
install zsh
sudo apt install zsh
install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
set zsh
to default Shell environment
chsh -s $(which zsh)
theme
ZSH_THEME="half-life"
suggests commands as you type based on history and completions.
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):
plugins=(
# other plugins...
zsh-autosuggestions
)
highlight for zsh
command
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
Activate the plugin in ~/.zshrc:
plugins=( [plugins...] zsh-syntax-highlighting)
快速跳转不同的目录、路径、文件夹
将 python
指向 pyhton3
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo ln -s /usr/bin/pip3 /usr/bin/pip
安装
git clone https://github.com/wting/autojump.git
cd autojump
./install.py
add to ~/.zshrc
[[ -s /home/jalen/.autojump/etc/profile.d/autojump.sh ]] && source /home/jalen/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u
git config --global user.name "Jalen"
git config --global user.email "jalenzzz@qq.com"
ssh-keygen -t rsa -C "jalenzzz@qq.com"
cat ~/.ssh/id_rsa.pub
gpg --import public.key
gpg --import private.key
git config --global user.signingkey "GPG Key ID"
git config --global commit.gpgsign true
# sudo gedit /etc/X11/Xsession.d/55gnome-session_gnomerc
xrandr --output Virtual1 --rotate left
git clone https://github.com/vinceliuice/WhiteSur-gtk-theme.git
cd WhiteSur-gtk-theme
./install.sh -i ubuntu
# GDM theme
sudo ./tweaks.sh -g
# icons
git clone https://github.com/vinceliuice/WhiteSur-icon-theme.git
cd hiteSur-icon-theme
./install.sh -b
# Gnome Backgrounds
git clone https://github.com/vinceliuice/WhiteSur-wallpapers.git
cd WhiteSur-wallpapers
sudo ./install-gnome-backgrounds.sh
# Grub Theme
git clone https://github.com/vinceliuice/grub2-themes.git
cd grub2-themes
sudo ./install.sh -t whitesur -i whitesur -s ultrawide2k