openSUSE is an RPM-based distribution, which is in line with RHEL/CentOS. But its official package manager is a proprietary zypper, which works quite well, and the software is quite new.

I recently switched from Manjaro to openSUSE and found that the KDE desktop is indeed smoother than Manjaro and the community source OBS experience is more comfortable than AUR.

Especially for containers/Kubernetes, the source is richer than AUR and is officially maintained. This article is a summary of the migration process.

This article is based on openSUSE Tumbleweed, which is a rolling distribution like Manjaro/Arch, with newer sources. Most users in the openSUSE community use Tumbleweed. It also has better hardware compatibility than openSUSE Leap (stable version) - I tested a Xiaomi gaming notebook with Leap installed and the Touchpad would not work after hibernation.

zypper’s basic commands

zypper’s source is slow in China, but actually when downloading, zypper will intelligently select the fastest mirror source to download the package, such as the domestic Tsinghua source, etc.

But I found that the official source index is too slow to update, and even often fails. So there is no way, or have to manually set the mirror source: the

1
2
3
4
5
# 禁用原有的官方软件源
sudo zypper mr --disable repo-oss repo-non-oss repo-update repo-update-non-oss repo-debug
# 添加北外镜像源
sudo zypper ar -fcg https://mirrors.bfsu.edu.cn/opensuse/tumbleweed/repo/oss/ bfsu-oss
sudo zypper ar -fcg https://mirrors.bfsu.edu.cn/opensuse/tumbleweed/repo/non-oss/ bfsu-non-oss

Then there are the usual zypper commands.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
sudo zypper refresh  # refresh all repos
sudo zypper update   # update all softwares

sudo zypper search --installed-only  <package-name>  # 查找本地安装的程序
sudo zypper search <package-name>  # 查找本地和软件源中的程序

sudo zypper install <package-name>  # 安装程序
sudo zypper remove --clean-deps <package-name>  # 卸载程序,注意添加 --clean-deps 或者 -u,否则不会卸载依赖项!

sudo zypper clean  # 清理本地的包缓存

Install Softwares

Here you need to use OBS (Open Build Service, similar to arch’s AUR, but a pre-compiled package), because there are too many OBS things, so there is no complete domestic mirror, the average speed is about 300kb/s. The average speed is about 300kb/s. It is recommended to add a smart proxy on the router to speed up.

Install all kinds of software you need:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 启用 Packman 仓库,使用北交镜像源
sudo zypper ar -cfp 90 'https://mirror.bjtu.edu.cn/packman/suse/openSUSE_Tumbleweed/' packman-bjtu

# install video player and web browser
sudo zypper install mpv ffmpeg-4 chromium firefox

# install screenshot and other utils
# 安装好后可以配个截图快捷键 alt+a => `flameshot gui`
sudo zypper install flameshot peek nomacs

# install git clang/make/cmake
sudo zypper install git gcc clang make cmake

# install wireshark
sudo zypper install wireshark
sudo gpasswd --add $USER wireshark  #  将你添加到 wireshark 用户组中

IDE + programming language

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# install vscode: https://en.openSUSE.org/Visual_Studio_Code
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo zypper addrepo https://packages.microsoft.com/yumrepos/vscode vscode
sudo zypper refresh
sudo zypper install code

# 安装 dotnet 5: https://docs.microsoft.com/en-us/dotnet/core/install/linux-openSUSE#openSUSE-15-
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo zypper addrepo https://packages.microsoft.com/openSUSE/15/prod/ microsoft-prod
sudo zypper refresh
sudo zypper install dotnet-sdk-5.0

# 安装新版本的 go(源中的版本比较低,更建议从 go 官网下载安装)
sudo zypper install go

Installation via tarball/script.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# rustup,rust 环境管理器
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# jetbrains toolbox app,用于安装和管理 pycharm/idea/goland/android studio 等 IDE
# 参见:https://www.jetbrains.com/toolbox-app/

# 不使用系统 python,改用 miniconda 装 python3.8
# 参考:https://github.com/ContinuumIO/docker-images/blob/master/miniconda3/debian/Dockerfile
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh
sudo /bin/bash /tmp/miniconda.sh -b -p /opt/conda
rm /tmp/miniconda.sh
sudo /opt/conda/bin/conda clean -tipsy
sudo ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
echo "conda activate base" >> ~/.bashrc
# miniconda 的 entrypoint 默认安装在如下目录,添加到 PATH 中
echo "export PATH=\$PATH:\$HOME/.local/bin" >> ~/.bashrc

Next, install the VSCode plugins, the following is my list of plugins.

  1. Language:
    1. python/go/rust/c#/julia/flutter
    2. xml/yaml/toml
    3. vscode proto3
  2. ansible/terraform
  3. markdown all in one + Markdown Preview Enhanced
  4. Beautification.
    1. community material theme
    2. vscode icons
    3. glasslt-vsc
  5. docker/kubernetes
  6. IntelliJ IDEA Keybindings
  7. gitlens
  8. prettier
  9. utils
    1. comment translate
    2. path intellisense
    3. svg
    4. visual studio intellicode
  10. antlr4
  11. remote ssh + remote containers
  12. rest client
  13. vscode databases

Containers + Kubernetes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# 时髦的新容器套装: https://documentation.suse.com/sles/15-SP2/html/SLES-all/cha-podman-overview.html
sudo zypper in podman kompose skopeo buildah katacontainers
# 安装 kubernetes 相关工具,tumbleweed 官方仓库的包都非常新!很舒服
sudo zypper in helm k9s kubernetes-client

# 本地测试目前还是 docker-compose 最方便,docker 仍有必要安装
sudo zypper in docker
sudo gpasswd --add $USER docker
sudo systemctl enable docker
sudo systemctl start docker

# 简单起见,直接用 pip 安装 docker-compose 和 podman-compose
sudo pip install docker-compose podman-compose

Office, music, chat

1
2
3
4
5
6
7
8
# 添加 openSUSE_zh 源:https://build.opensuse.org/project/show/home:opensuse_zh
sudo zypper addrepo 'https://download.opensuse.org/repositories/home:/opensuse_zh/openSUSE_Tumbleweed' openSUSE_zh
sudo zypper refresh
sudo zypper install wps-office netease-cloud-music

# linux qq: https://im.qq.com/linuxqq/download.html
# 虽然简陋但也够用,发送文件比 KDE Connect 要方便一些。
sudo rpm -ivh linux_qq.rpm

Install input method

The input method I’m using is Xiaohe phonetic, first install fcitx-rime:

1
2
3
4
# 添加 m17n obs 源:https://build.openSUSE.org/repositories/M17N
sudo zypper addrepo 'https://download.opensuse.org/repositories/M17N/openSUSE_Tumbleweed' m17n
sudo zypper refresh
sudo zypper install fcitx5 fcitx5-configtool fcitx5-qt5 fcitx5-rime

Then, download the latest mouse whiskers (MacOS) configuration file from http://flypy.ys168.com/, and copy the unpacked rime folder to ~/.local/share/fcitx5/ under.

1
mv rime ~/.local/share/fcitx5/

Now reboot the system and add rime “Zhongzhou rhyme” inside the fcitx5 configuration, and you can use Xiaohe phonetic form normally.

QEMU/KVM

I have to say, openSUSE installation of KVM is really super convenient, pure GUI operation:.

1
2
3
# see: https://doc.openSUSE.org/documentation/leap/virtualization/html/book-virt/cha-vt-installation.html
sudo yast2 virtualization
# enter to terminal ui, select kvm + kvm tools, and then install it.

KDE Connect

KDE Connect is a PC phone collaboration tool that allows you to share clippings, remote input, send files, share folders, sync notifications, etc. between your computer and phone. All in all it works very well, as long as the phone and PC are on the same LAN, no data cable is needed.

If you choose to open the firewall when you install the system, KDE Connect cannot be connected, you need to open the port number manually.

1
2
3
4
5
# see: https://userbase.kde.org/KDEConnect#firewalld
# 还可以使用 --add-source=xx.xx.xx.xx/xx 设置 ip 白名单
sudo firewall-cmd --zone=public --permanent --add-port=1714-1764/tcp
sudo firewall-cmd --zone=public --permanent --add-port=1714-1764/udp
sudo systemctl restart firewalld.service

Then install KDE Connect on your phone (Android) and start enjoying it.

Current bugs:

  • Android 10 disables background apps from reading the clipboard, which causes KDE Connect to only sync from PC to phone, but not reverse.
    • If you have ROOT permission, you can refer to Fix clipboard permission on Android 10 and install ClipboardWhitelist to open the permission.
    • Otherwise, it seems that you can only use the “Remote Input” module on the phone to transfer text manually.

Qv2ray Proxy

Qv2ray is one of the better GUI proxy tools I’ve used, supporting all common proxy protocols via plugins.

1
2
3
4
# see: https://build.openSUSE.org/repositories/home:zzndb
sudo zypper addrepo 'https://download.opensuse.org/repositories/home:/zzndb/openSUSE_Tumbleweed' qv2ray
sudo zypper refresh
sudo zypper install Qv2ray QvPlugin-Trojan QvPlugin-SS

VPN connection with firewall

The firewall disables ports for vpn protocols such as pptp by default, you need to open them manually.

PPTP protocol is allowed.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 允许 gre 数据包流入网络
sudo firewall-cmd --permanent --zone=public --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT
sudo firewall-cmd --permanent --zone=public --direct --add-rule ipv6 filter INPUT 0 -p gre -j ACCEPT

# masquerade: 自动使用 interface 地址伪装所有流量(将主机当作路由器使用,vpn 是虚拟网络,需要这个功能)
sudo firewall-cmd --permanent --zone=public --add-masquerade
# pptp 客户端使用固定端口 1723/tcp 通信
firewall-cmd --add-port=1723/tcp --permanent

sudo firewall-cmd --reload

The wireguard protocol is allowed. This protocol only uses the tcp protocol, and the port number can be customized. However, wireguard’s own configuration file /etc/wireguard/xxx.conf can be configured with iptables parameters to release the relevant ports, so we won’t go into that here.

Other settings

You can change this in “System Settings” - “Workspace Behavior” - “General Behavior” - “Click Behavior”.