记录ubuntu的安装过程。
安装操作系统
https://ubuntu.com/download/desktop
优化apt
登录时使用Ubuntu on X11 Org,否则Theme不能切换。因为Gnome Wayland不成熟。
Recommend: Software & Update->Download from->Other去选择aliyun镜像。如果手动的话参考以下方式:
1 | sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak |
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" |
配置环境变量
vim ~/.bash_profile1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
alias ll="ls -l"
alias k=kubectl
source <(kubectl completion bash | sed s/kubectl/k/g)
function proxy_off(){
unset http_proxy
unset https_proxy
echo -e "The proxy has been closed!"
}
function proxy_on() {
export no_proxy="127.0.0.1,localhost,10.0.0.0/8,172.0.0.0/8,192.168.0.0/16,*.zerofinance.net,*.aliyun.com,*.163.com,*.docker-cn.com,registry.gcalls.cn"
export http_proxy="http://127.0.0.1:1082"
export https_proxy=$http_proxy
echo -e "The proxy has been opened!"
}
source ~/.bash_profile
rc.local
1 | #http://www.atmcu.com/2256.html |
搜狗输入法 for linux
1 | #https://shurufa.sogou.com/linux |
系统快捷键
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 |
gnome-shell
安装:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#For 22.04
sudo apt install gnome-tweaks chrome-gnome-shell gnome-shell-extension-manager
#open with firefox or chrome
https://extensions.gnome.org
#Click: Click here to install browser extension
plugin:
User Themes: https://extensions.gnome.org/extension/19/user-themes/
#dock-from-dash: https://extensions.gnome.org/extension/4703/dock-from-dash/
dash2dock-lite: https://extensions.gnome.org/extension/4994/dash2dock-lite/
dash-to-panel: https://extensions.gnome.org/extension/1160/dash-to-panel/
arc menu: https://extensions.gnome.org/extension/3628/arcmenu/
Gnome Wayland不成熟,登录时使用Ubuntu on X11 Org,否则Theme不能切换。
##Disable wayland on Ubuntu 22.04 Desktop
##https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-22-04-desktop
#echo $XDG_SESSION_TYPE
#sudo nano /etc/gdm3/custom.conf
##Within this file, look for the line that says #WaylandEnable=false. You can uncomment this line and either set it to true or #false, depending on whether you want Wayland enabled or not.
#WaylandEnable=false
##Restart
#sudo systemctl restart gdm3
Wine
企业微信需要用wine7安装才会有消息提醒,推荐使用:
1 | #https://www.cnblogs.com/hyaline-doc/p/18011541 |
VPN
1 | sudo apt install openconnect |
SecureCRT
1 | #libssl1.0.0 |
Navicat Premium 15
1 | sudo apt install libfuse2 |
Cider
1 | #https://cider.sh/ |
字体
1 | #wget "https://dl-sh-ctc-2.pchome.net/25/rm/YosemiteSanFranciscoFont-master.zip" |
San Francisco Text Medium
WPS字体
1 | #https://blog.huzhifeng.com/2017/01/15/WPS/ |
开机画面
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
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 | systemctl disable iptables |
History docker installation:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15docker version is: 20.10.7:
#https://blog.csdn.net/u011519550/article/details/102688892
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
apt-cache madison docker-ce
apt install docker-ce-cli=5:20.10.7~3-0~ubuntu-xenial docker-ce=5:20.10.7~3-0~ubuntu-xenial
Ubuntu: Failed to get D-Bus connection: No such file or directory:
cat /etc/rc.local
sudo mkdir /sys/fs/cgroup/systemd
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
#reboot and docker start your container.
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