记录ubuntu的安装过程。
安装操作系统
https://ubuntu.com/download/desktop
优化apt
登录时使用Ubuntu on X11 Org,否则Theme不能切换。因为Gnome Wayland不成熟。
Recommend: Software & Update->Download from->Other去选择aliyun镜像。
Update:1
2
3
4
5sudo apt update
#apt
sudo add-apt-repository ppa:apt/stable
sudo apt install apt-fast
sudo apt upgrade
安装基础包
1 | #sudo apt install software-properties-common |
修改操作系统配置
完整脚本:
1 | apt-get update |
Safe-RM
rm.sh:1
2
3
4
5
6
7
8
9
10
11
12sudo mkdir -p /works/shell /works/backup
sudo chown -R dave.dave /works/
chmod +x /works/shell/*
#https://superuser.com/questions/192725/how-can-i-alias-a-command-for-sudo
cat >> /etc/profile <<EOF
alias sudo='sudo '
alias rm="/works/shell/rm.sh"
EOF
. /etc/profile
GIT
1 | git config --global user.name "dave.zhao" |
配置环境变量
kubectl:
1 | curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" |
vim ~/.bash_profile
1 | test -f ~/.profile && . ~/.profile |
自带的Terminal需要配置一下才能读取~/.bash_profile,配置如下:Preferences—>Unnamed—>Command:
勾选:Run command as a login shell.
rc.local
1 | #rc.local |
中文输入法 for linux
搜狗输入法
https://zhuanlan.zhihu.com/p/19244447841913130561
2
3
4
5
6
7
8
9
10
11
12
13
14# 更新系统软件包
sudo apt update
# 卸载 Fcitx5 和 IBus(如果存在)
sudo apt remove --purge fcitx5* ibus*
# 清理系统残留
sudo apt autoremove && sudo apt autoclean
# 安装 Fcitx4 输入法框架
sudo apt install fcitx
# 设置 Fcitx 开机自启动
sudo cp /usr/share/applications/fcitx.desktop /etc/xdg/autostart/
https://shurufa.sogou.com/linux/guide1
2
3
4
5
6
7打开系统设置:Settings → Region & Language
点击 Manage Installed Languages
在弹出的"语言支持"窗口中:
点击 Install / Remove Languages...
勾选 Chinese (simplified),点击 Apply
在 Keyboard input method system 下拉菜单中选择 fcitx
点击 Apply System-Wide
1 | # 安装必要的依赖包 |
解决不能输入中文:
https://blog.csdn.net/wesleyflagon/article/details/1315642161
2
3
4
5
6
7
8
9
10sudo cp /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Qml.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5DBus.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5DBus.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Gui.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Widgets.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Core.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Network.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Quick.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5QuickWidgets.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5QuickWidgets.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5Svg.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5Svg.so.5
sudo cp /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5 /opt/sogoupinyin/files/bin/../lib/qt5/lib/libQt5XcbQpa.so.5
重启电脑
fcitx5中文拼音输入法
1 | #https://zhuanlan.zhihu.com/p/675895900 |
系统快捷键
1 | #sudo apt install deepin-screenshot |
NODEJS
1 | #https://github.com/nvm-sh/nvm |
安装常用工具:1
2
3
4
5
6
7
8
9
10
11npm config set registry https://registry.npmmirror.com --global
npm config set disturl https://npmmirror.com/dist --global
npm install hexo-cli -g
npm install hexo-server -g
npm install hexo-deployer-git -g
npm install yarn -g
npm install http-server -g
yarn config set registry https://registry.npmmirror.com --global
yarn config set disturl https://npmmirror.com/dist --global
#yarn global add serve
JAVA
1 | sudo mkdir -p /Developer/java /Developer/workspace |
sudo vim /etc/profile.d/java.sh1
2
3
4
5
6
7export JAVA_HOME=/Developer/java/jdk-11.0.9
#export JAVA_HOME=$(/usr/libexec/java_home)
export M2_HOME=/Developer/apache-maven-3.5.4
export GRADLE_USER_HOME=/Developer/.gradle
export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH
source /etc/profile
gnome-shell
Disable Wayland
Gnome Wayland不成熟,登录时使用Ubuntu on X11 Org,否则Theme不能切换。
1 | ##Disable wayland on Ubuntu 22.04 Desktop |
plugin
1 | sudo apt install gnome-tweaks chrome-gnome-shell gnome-shell-extension-manager |
Theme
1 | #https://www.pling.com/p/1403328 |
VPN
1 | sudo apt install openconnect |
Tabby
https://github.com/Eugeny/tabby
1 | sudo apt install ./tabby-1.0.229-linux-x64.deb |
字体
Windows字体
https://www.cnblogs.com/liutongqing/p/7923297.html
1 | sudo mkdir -p /usr/share/fonts/truetype/windows-font/ |
MacOS字体
1 | sudo git clone https://github.com/AppleDesignResources/SanFranciscoFont /usr/share/fonts/truetype/macos-font/ |
WPS字体
1 | # #https://blog.huzhifeng.com/2017/01/15/WPS/ |
ytdlp-gui
https://github.com/BKSalman/ytdlp-gui
1 | sudo apt install ./ytdlp-gui_3.1.2-1_amd64.deb |
xunlei
https://www.bilibili.com/video/BV1E54y1m7Gx/
https://parallel.lanzoul.com/ij7qxgle7ud
1 | sudo apt install ./xunlei_1.0.0.1-myubuntu_amd64.deb |
开机画面
1 | #https://www.gnome-look.org/browse/cat/109/ord/latest/ |
SysMonitor
1 | #https://www.zhyong.cn/posts/f35/ |
Zerotier
1 | #https://blog.csdn.net/awzs7758520/article/details/130127967 |
路由不通解决:1
2
3
4
5
6
7
8
9
10
11
12#https://zhichao.org/posts/zerotier
通过上面的设置,已经实现了连接到 ZeroTier 的设备使用内网 IP 访问局域网,但是局域网内的设备仍然无法使用 ZeroTier 分配的 IP 来访问那些连接到 ZeroTier 的设备,我们还需要在路由器中配置静态路由:
内部网络--->路由设置:
网络 / 主机 IP: 与 ZeroTier 网段保持一致: 192.168.195.0
网络掩码: 与 ZeroTier 掩码保持一致 (/24 为 255.255.255.0): 255.255.255.0
网关: 安装 ZeroTier 设备的内网 IP: 192.168.3.2
#OpenWRT的参考:
https://www.douban.com/note/841817168/?_i=00754617wYVM7F,0086159YLqUxZi
X11vnc
https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R5S/zh
1 | sudo apt-get install x11vnc |
客户端可以使用:xtightvncviewer、vncviewer、Remmina
注意:1
21. ip:5900
2. vnc复制粘贴中文会乱码。
XRDP
1 | sudo apt install xrdp |
完美方案——解决XRDP连接黑屏,以及桌面优化:
1 | #https://www.cnblogs.com/bruce1992/p/16535833.html |
Xrdp 体验优化 减少/解决画面卡顿:
1 | #https://blog.csdn.net/wu_weijie/article/details/116158271 |
EQ13 Ubuntu Bluetooth
1 | sudo dmesg|grep Bluetooth |
修复grub
1 | #view UUID |
MySQL
二进制文件安装
全自动安装:
1 |
|
手动安装:
1 | #https://blog.csdn.net/weixin_36349646/article/details/102616914 |
docker安装
1 | #https://raw.githubusercontent.com/zhaoxunyong/stock-webapp/1.1.x/backend/README.md |
Docker
1 | sudo apt install docker.io |
Creating centos instance with restrict cpu and memory:1
docker run -d --privileged=true --cpus=4 --cpu-shares=4000 -m 2048m --memory-reservation=256m --name mycento registry.zerofinance.net/library/centos:7 /usr/sbin/init
simple-http-server
https://github.com/TheWaWaR/simple-http-server
1 | wget https://github.com/TheWaWaR/simple-http-server/releases/download/v0.6.13/x86_64-unknown-linux-musl-simple-http-server |
Nvidia Driver
1 | #Remove the latest version: |
TouchPad Driver
Thinkbook 16+ 2025需先升级ubuntu到24.10及以上版本,参考:
https://www.bilibili.com/opus/1085833462664921088
1.获取本机硬件ID (DMI Modalias)1
cat /sys/class/dmi/id/modalias
2.创建配置目录和文件1
2sudo mkdir -p /etc/libinput/
sudo vim /etc/libinput/local-overrides.quirks
3.写入、修改并保存配置1
2
3
4
5
6
7# ThinkBook 16 G7+ IAH models come with pressure pads that were not
# correctly declared as such.
[Lenovo ThinkBook 16 G7+ IAH touchpad]
MatchName=*GXTP5100*
MatchDMIModalias=填入步骤1中ID
MatchUdevType=touchpad
ModelPressurePad=1
4.重启Ubuntu系统,加载配置文件
另外一种方式,不建议:
https://marcobisky.github.io/posts/ubuntu-touchpad/index.html
1 | sudo apt install xserver-xorg-input-libinput xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-synaptics |