目录
实机安装
原来在用 Ubuntu 19.10,通过 do-release-upgrade
升级到 Ubuntu 20.04 后,因为一些配置出现了些奇怪的问题,索性重新安装了一次。记录一下安装优化过程。
在 Dash 里搜索 软件和更新
,依次点击 Ubuntu软件
- 下载自
- 其他站点
- 中国
:
然后选择一个源服务器,推荐阿里云和清华:
sudo cp -r /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i "s/\/\/.*archive.ubuntu.com/\/\/mirrors.aliyun.com/g;s/\/\/.*security.ubuntu.com/\/\/mirrors.aliyun.com/g" /etc/apt/sources.list
然后 update 一下:
sudo apt update
sudo apt upgrade
在系统设置
里按自己的习惯设置即可。
sudo apt install gnome-tweak-tool
对于 FPS 玩家,尤其推荐去掉鼠标加速。
4.1. 在 GNOME Tweaks
点击 键盘和鼠标
在 鼠标
-加速配置
里选择Flat
。
4.2. 在 系统设置
里设备
-鼠标和触摸板
-鼠标
-鼠标速度
调节自己适应的鼠标速度。
下载安装 MouseWheel
https://github.com/muharemovic/MouseWheel
常用的个人电脑,是可以运行sudo
免输密码的,公用电脑不建议这样设置。
进入超级用户,注意su
后面的 -
。
su -
vim /etc/sudoers
在root ALL=(ALL:ALL) ALL
下一行添加:
eallion ALL=(ALL:ALL) ALL
在%sudo ALL=(ALL:ALL) ALL
下一行添加:
eallion ALL=(ALL:ALL) NOPASSWD:ALL
替换其中的eallion
用户名。
sudo apt install gdebi
安装 deb 软件包时,可以用 GDebi 替换 Ubuntu 软件中心。
下载地址:https://www.google.com/chrome/
9.1、 传统的 Fcitx 五笔拼音
sudo apt install fcitx-table-wbpy
主题: https://github.com/Yucklys/fcitx-nord-skin
主题: https://github.com/Sakitami/fcitx-themes-package
自定义标点符号:
sudo vim ~/.config/fcitx/data/punc.mb.zh_CN
添加下面的符号,如果不符合习惯请自行修改。
~ ~
` `
! !
@ @
# #
$ ¥
% ␣
^ ⋯⋯
& ÷
* *
( (
) )
_ ——
- -
+ +
= =
| |
\ 、
{ 『 』
} 〖 〗
[ 【
] 】
: :
; ;
" “ ”
' ‘ ’
<《
> 》
, &#xff0c;
. 。
? &#xff1f;
9.2、 Fcitx5-rime 中州韵
sudo apt install fcitx5 fcitx5-pinyin fcitx5-chinese-addons fcitx5-frontend-gtk2 fcitx5-frontend-gtk3 fcitx5-frontend-qt5
sudo add-apt-repository ppa:hosxy/fcitx5
sudo apt update
sudo apt install kde-config-fcitx5
安装 Kimpanel&#xff1a; https://github.com/wengxt/gnome-shell-extension-kimpanel
主题&#xff1a; https://github.com/hosxy/Fcitx5-Material-Color
主题&#xff1a; https://github.com/hosxy/Fcitx5-Materia-EXP
9.3、 其他输入法请自行 Google
到目前为止&#xff0c;国产的那几个输入法Linux版都不太好用。
Preload 是一个后台运行的守护进程&#xff0c;它分析用户行为和频繁运行的应用&#xff0c;让你更快打开常用的软件。
sudo apt install preload
若有需要
减少过热和使用节能模式。
sudo add-apt-repository ppa:linrunner/tlp
sudo apt update
sudo apt install tlp tlp-rdw
sudo tlp start
安装 CPUFREQ 指示器&#xff1a;
sudo apt install indicator-cpufreq
重启你的电脑即可在指示器上选择 Powersave 模式。
现在的大宽带感觉不需要
apt-fast 是 apt 的一个 shell 脚本包装器&#xff0c;通过从多连接同时下载包来提升更新及包下载速度。
如果你经常使用终端以及 apt 来安装和更新包&#xff0c;你也许会想要试一试 apt-fast 。
安装 apt-fast&#xff1a;
sudo add-apt-repository ppa:apt-fast/stable
sudo apt update
sudo apt install apt-fast
解决切换到 Windows 发现时间不对的问题。
sudo apt install ntpdate
sudo ntpdate ntp.aliyun.com #阿里云的时间服务器
sudo hwclock --localtime --systohc #将时间更新到硬件上
直接安装的 Guake 版本不够新&#xff0c;而且中文显示不全。
推荐源码安装&#xff1a;
sudo apt update
sudo apt -y install git curl wget
cd ~
git clone https://github.com/Guake/guake.git
cd guake
./scripts/bootstrap-dev-debian.sh run make
make
sudo make install
Ubuntu 20.04 默认终端的背景色&#xff1a;#300a24
如果需要直接从软件仓库安装&#xff08;版本比较旧&#xff09;&#xff1a;
sudo apt install guake
sudo apt install guake-indicator
参考&#xff1a;Ubuntu 配置 Oh-My-Zsh - 大大的小蜗牛 — 机会总是垂青于有准备的人
安装 Zsh&#xff1a;
sudo apt update
sudo apt install zsh
将 Zsh 设置为默认 Shell &#xff1a;
chsh -s /bin/zsh
查看当前所用的 Shell &#xff1a; echo $SHELL
。
安装 Oh My Zsh &#xff1a;
以下几种方式选择1种&#xff1a;
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl -Lo install.sh https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
sh install.sh
字体可以安装 Powerline &#xff0c;但是推荐安装符号更全的 Ubuntu Nerd Font 或者 Knack Nerd Font Mono。在 Guake 里设置好。
下载&#xff1a;Ubuntu Nerd Font
下载&#xff1a;Knack Nerd Font Mono
下载后直接安装字体即可。
安装主题 Powerlevel9k &#xff1a;
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
安装插件&#xff1a;
# autojump 切换目录
sudo apt install autojump# fasd 快速访问文件或目录
sudo apt install fasd# zsh-autosuggestions 历史命令建议
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-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
设置 Oh My Zsh &#xff1a;
vim ~/.zshrc
需要修改如下几个地方&#xff1a;
******
POWERLEVEL9K_MODE&#61;&#39;nerdfont-complete&#39;
ZSH_THEME&#61;"powerlevel9k/powerlevel9k"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS&#61;(context dir dir_writable disk_usage vcs newline)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS&#61;(status root_indicator background_jobs history time)******
ENABLE_CORRECTION&#61;"true"******
COMPLETION_WAITING_DOTS&#61;"true"******
plugins&#61;( git extract fasd zsh-autosuggestions zsh-syntax-highlighting docker docker-compose)******
让配置生效&#xff1a;
source ~/.zshrc
https://github.com/spf13/spf13-vim
https://github.com/LER0ever/EverVim
Ubuntu 配置 EverVim Ubuntu 配置 EverVim - 大大的小蜗牛 — 机会总是垂青于有准备的人
18.1、常规安装的 Ubuntu 配置 Grub
用 Grub-customizer 即可
sudo apt install grub-customizer
Theme: https://github.com/gustawho/grub2-theme-breeze
如果独立显卡在引导界面开机黑屏&#xff1a;将nomodeset
加到/etc/default/grub
即可。
18.2、ZFS 文件系统配置 Grub
https://openzfs.github.io/openzfs-docs/Getting Started/Ubuntu/Ubuntu 20.04 Root on ZFS.html#step-5-grub-installation
1、验证是否为 ZFS 文件系统&#xff1a;
sudo grub-probe /boot
2、刷新一下初始根磁盘&#xff1a;
sudo update-initramfs -c -k all
3、禁止内存清零&#xff1a;
sudo vim /etc/default/grub
添加init_on_alloc&#61;0
参数到GRUB_CMDLINE_LINUX_DEFAULT
里&#xff1a;
GRUB_CMDLINE_LINUX_DEFAULT&#61;"init_on_alloc&#61;0"
4、一些建议的设置&#xff08;非必要&#xff09;
# GRUB_TIMEOUT_STYLE&#61;hidden # 注释掉这一行
GRUB_TIMEOUT&#61;5
GRUB_RECORDFAIL_TIMEOUT&#61;5
GRUB_CMDLINE_LINUX_DEFAULT&#61;"nomodeset init_on_alloc&#61;0"
GRUB_TERMINAL&#61;console
5、更新配置
sudo update-grub
6、安装引导
sudo grub-install $DISK
sudo grub-install --target&#61;x86_64-efi --efi-directory&#61;/boot/efi \
--bootloader-id&#61;ubuntu --recheck --no-floppy
sudo cp -a /boot/efi/EFI /boot/efi2
sudo grub-install --target&#61;x86_64-efi --efi-directory&#61;/boot/efi2 \
--bootloader-id&#61;ubuntu-2 --recheck --no-floppy
7、禁用grub-initrd-fallback.service
&#xff1a;
sudo systemctl mask grub-initrd-fallback.service
8、修复文件系统挂载顺序
sudo mkdir /etc/zfs/zfs-list.cache
sudo touch /etc/zfs/zfs-list.cache/bpool
sudo touch /etc/zfs/zfs-list.cache/rpool
sudo ln -s /usr/lib/zfs-linux/zed.d/history_event-zfs-list-cacher.sh /etc/zfs/zed.d
sudo zed -F &
sudo cat /etc/zfs/zfs-list.cache/bpool
sudo cat /etc/zfs/zfs-list.cache/rpool
sudo zfs set canmount&#61;noauto bpool/BOOT/ubuntu_$UUID
sudo zfs set canmount&#61;noauto rpool/ROOT/ubuntu_$UUID
fg
Press Ctrl-C.
sudo sed -Ei "s|/mnt/?|/|" /etc/zfs/zfs-list.cache/*
查看硬盘的 UUID 和 Type &#xff1a;
sudo blkid
记录下UUID和Type。
创建挂载目录&#xff1a;
cd ~
sudo mkdir Files
sudo chown -R eallion:eallion Files
查看自己的 uid gid&#xff1a;
id eallion
编辑配置文件&#xff1a;
sudo vim /etc/fstab
按格式添加&#xff1a;
UUID&#61;xxxx /mount-folder type defaults 0 0
如&#xff1a;
UUID&#61;0002AC /home/eallion/Files ntfs defaults,uid&#61;1000,gid&#61;1000,umask&#61;022 0 0
UUID&#61;0002AD /home/eallion/Media ntfs defaults,uid&#61;1000,gid&#61;1000,umask&#61;022 0 0
如果不加 uid gid &#xff0c;自动挂载后是 root 权限&#xff0c;可能无法读写。
sudo apt install openssh-server
配置Google Authenticator&#xff1a;&#xff08;非必须&#xff0c;可选&#xff09;
如果不打算用二次验证登录&#xff0c;不要执行下面的步骤
sudo apt install libpam-google-authenticator
生成二维码&#xff1a;
google-authenticator
修改配置以加载 Google-authenticator&#xff1a;
sudo vim /etc/pam.d/sshd
添加&#xff1a;
auth required pam_google_authenticator.so
修改 SSH 配置&#xff1a;
sudo vim /etc/ssh/sshd_config
ChallengeResponseAuthentication yesPort 65537 # 修改自己想要的 SSH 端口
sudo apt install flameshot
设置截图快捷键&#xff1a;系统设置
- 设备
- 键盘快捷键
- 自定义快捷键
点加号添加一个&#xff1a;
名称&#xff1a;flameshot
命令&#xff1a;flameshot gui
设置快捷键&#xff1a;&#xff08;按键盘设置&#xff09;
Ubuntu 20.04.1 好像没有这个问题了
当主机接有音响、耳机、HDMI设备的话&#xff0c;Ubuntu默认是采用HDMI输出音频。
Ubuntu自带的声音设置修改后不能保存&#xff0c;下次又还原成默认的。
安装PulseAudio &#xff1a;
sudo apt install pavucontrol
然后按Super
键在Dash
中打开PulseAudio
&#xff0c;在设备
选项卡中关闭HDMI即可。
sudo apt install ubuntu-restricted-extras
Install Docker Engine on Ubuntu | Docker Documentation
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch&#61;amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt install -y docker-ce docker-ce-cli containerd.io
检查是否安装成功&#xff1a;
docker version
sudo docker run hello-world
安装 Docker Compose&#xff1a;
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod &#43;x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Docker 属于高频操作&#xff0c;运行 Docker 时&#xff0c;免去 sudo
Post-installation steps for Linux | Docker Documentation
sudo groupadd docker
sudo usermod -aG docker $USER
reboot
newgrp docker
sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g&#43;rwx "$HOME/.docker" -R
参考&#xff1a;Ubuntu 20.04.1 配置 LNMP 本地环境备忘 - 大大的小蜗牛 — 机会总是垂青于有准备的人
建议在安装之前加密硬盘 Ubuntu ZFS 原生全盘加密 - 大大的小蜗牛 — 机会总是垂青于有准备的人
教程&#xff1a;Ubuntu ZFS 加密 Home 目录 - 大大的小蜗牛 — 机会总是垂青于有准备的人
27.1. 安装浏览器插件
27.2. 安装 Gnome Shell Extensions
sudo apt install gnome-shell-extensions
27.3. 安装扩展
sudo gnome-extensions disable ubuntu-dock&#64;ubuntu.com
sudo apt install gir1.2-lunar-date-2.0
https://github.com/eallion/Big-Sur-Ubuntu
28.1、下载 Big Sur
cd ~/Pictures
git clone https://github.com/eallion/Big-Sur-Ubuntu.git
28.2、设置
打开Gnome Tweaks
找到外观
-背景
选择/home/xx_username_xx/Pictures/Big-Sur-Ubuntu/focal.xml
文件
选择Zoom
调整方式
推荐一些常用的软件&#xff1a;
sudo snap install authy --beta
sudo apt install filezilla
sudo apt install gimp
sudo apt install steam
sudo apt install telegram-desktop
sudo apt install virtualbox
sudo apt install vlc
Install Docker Engine on Ubuntu | Docker Documentation
https://www.dropbox.com/install
https://github.com/gohugoio/hugo/releases
The App - Install Linux | Keybase Docs
https://github.com/muharemovic/MouseWheel
网易云音乐
Ubuntu 20.04.1 配置 LNMP 本地环境备忘 - 大大的小蜗牛 — 机会总是垂青于有准备的人
Wiki - Install Instructions | OBS
--danderous
)https://github.com/Molunerfinn/PicGo
https://github.com/c0re100/qBittorrent-Enhanced-Edition
https://github.com/poplite/qBEE-Ubuntu-Packaging
QQ Linux版-从心出发·趣无止境
Linux | Downloads | Slack
Spotify for Linux
Termius for Linux | Download
https://typora.io/#linux
通过 Snap 仓库安装有中文输入 Bug 。
Download Visual Studio Code - Mac, Linux, Windows