办公主力机迁移到 Debian

  • 前段时间电脑好像中病毒了,好多软件被自动卸载,全盘杀毒也没扫出来,不知道是什么导致的
  • 决定把自己的办公主力机换成 Linux,选择了 Debian 12,记录下自己的安装历程

1. 基础

2. 企业微信

1
2
$ wget -O- https://deepin-wine.i-m.dev/setup.sh | sh
$ sudo apt install com.qq.weixin.work.deepin

3. 向日葵

  • 向日葵使用 lightdm 来进行界面渲染,但是 Debian 是通过 gdm3 进行图像处理
1
2
3
$ sudo apt install lightdm
# 配置默认视频管理插件
# $ sudo dpkg-reconfigure lightdm

4. FlameShot

1
$ sudo apt install flameshot
  • 设置全局快捷键:flameshot gui

5. OneDrive

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 安装
$ sudo apt remove onedrive
$ sudo add-apt-repository --remove ppa:yann1ck/onedrive
$ sudo rm /etc/systemd/user/default.target.wants/onedrive.service
$ sudo rm -rf /var/lib/dpkg/lock-frontend
$ sudo rm -rf /var/lib/dpkg/lock
$ sudo apt-get update
$ sudo apt-get upgrade -y
$ sudo apt-get dist-upgrade -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean -y
$ wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_12/Release.key | gpg --dearmor | sudo tee /usr/share/keyrings/obs-onedrive.gpg > /dev/null
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/obs-onedrive.gpg] https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/Debian_12/ ./" | sudo tee /etc/apt/sources.list.d/onedrive.list
$ sudo apt-get update
$ sudo apt install --no-install-recommends --no-install-suggests onedrive

# 认证
$ onedrive
Authorise this app by visiting: ......
Enter the response URI from your browser: ......
The application has been successfully authorised, but no additional command switches were provided.
# 配置同步文件夹
$ sudo cp /usr/share/doc/onedrive/config ~/.config/onedrive/
$ sudo chown $USER:$USER ~/.config/onedrive/config
$ vim ~/.config/onedrive/sync_list
/Document/
/MD/
# 手动同步
$ onedrive --sync
# 自动同步
$ systemctl start --user onedrive
$ systemctl enable --user onedrive

# 其他命令
$ onedrive --display-config
$ onedrive --sync --verbose --dry-run
$ onedrive --sync --local-first
$ onedrive --sync --single-directory '<dir_name>'
$ onedrive --sync --download-only --cleanup-local-files
$ onedrive --sync --upload-only --no-remote-delete
$ onedrive --create-share-link <path/to/file>

6. VNC

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ sudo apt install tigervnc-standalone-server tigervnc-common
$ vncpasswd
$ vim ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
export XKL_XMODMAP_DISABLE=1
export XDG_CURRENT_DESKTOP=KDE
export XDG_SESSION_TYPE=x11
export XDG_SESSION_DESKTOP=KDE
exec dbus-launch startplasma-x11
$ vim ~/.vnc/config
localhost = no
geometry = 1920x1080
depth = 24

$ vncserver :1 # 开启
$ vncserver -list
TigerVNC server sessions:
X DISPLAY # RFB PORT # RFB UNIX PATH PROCESS ID # SERVER
1 5901 87965 Xtigervnc
$ vncserver -kill :1 # 关闭

7. Navicat 16

1
2
3
4
5
6
7
$ sudo apt install dconf-cli
$ cat navicat.sh
#!/bin/bash
cp ~/.config/dconf/user ~/.config/dconf/user.bak
cp ~/.config/navicat/Premium/preferences.json ~/.config/navicat/Premium/preferences.json.bak
dconf reset -f /com/premiumsoft/navicat-premium/
sed -i -E 's/,?"([A-F0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/Premium/preferences.json

8. KDESvn

1
2
3
$ sudo apt install subversion
$ sudo apt install kdesvn
$ svn --username xxx --password xxx checkout http://xxx