04 July 2026

How to install Sogou Input on Ubuntu 24.04? Ubuntu 24.04 安装搜狗输入法完整教程

https://zhuanlan.zhihu.com/p/1924444784191313056

 

 

Ubuntu 24.04 安装搜狗输入法完整教程

40 人赞同了该文章

摘要

Ubuntu 24.04默认使用Fcitx5和Wayland,与搜狗输入法的Fcitx4框架存在兼容性问题。本教程通过降级到Fcitx4、切换到Xorg显示服务器、安装必要依赖等步骤,解决安装冲突和显示异常问题。经实际验证,可成功在Ubuntu 24.04上稳定运行搜狗输入法。

前言

Ubuntu 24.04 LTS 作为最新的长期支持版本,默认使用 Fcitx5 输入法框架,而搜狗输入法目前仍然基于 Fcitx4 框架。本教程将详细介绍如何在 Ubuntu 24.04 上成功安装搜狗输入法,并解决常见的兼容性问题。

环境说明

  • 系统版本:Ubuntu 24.04 LTS
  • 搜狗输入法版本:sogoupinyin_4.2.1.145_amd64.deb
  • 输入法框架:Fcitx4(需要从 Fcitx5 降级)

官方资源

安装步骤

第一步:系统环境准备

由于 Ubuntu 24.04 默认使用 Fcitx5,而搜狗输入法需要 Fcitx4 框架,我们需要先卸载 Fcitx5 并安装 Fcitx4。

# 更新系统软件包
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/

第二步:配置语言支持

  1. 打开系统设置:SettingsRegion & Language
  2. 点击 Manage Installed Languages
  3. 在弹出的"语言支持"窗口中:
  • 点击 Install / Remove Languages...
  • 勾选 Chinese (simplified),点击 Apply
  • Keyboard input method system 下拉菜单中选择 fcitx
  • 点击 Apply System-Wide

注意:如果在键盘输入法系统中没有"fcitx"选项,说明第一步的安装可能有问题,请重新执行 sudo apt install fcitx

第三步:下载搜狗输入法

前往官方下载页面:shurufa.sogou.com/linux

  1. 选择 Linux 个人版
  2. 选择 X86_64 架构
  3. 下载 sogoupinyin_4.2.1.145_amd64.deb 安装包

或者使用命令行直接下载:

# 创建下载目录
mkdir -p ~/Downloads/sogou

# 进入下载目录
cd ~/Downloads/sogou

# 下载搜狗输入法(请以官网最新版本为准)
wget https://ime.sogoucdn.com/202308071026/sogoupinyin_4.2.1.145_amd64.deb

第四步:安装搜狗输入法

# 进入下载目录
cd ~/Downloads/sogou

# 安装搜狗输入法
sudo dpkg -i sogoupinyin_4.2.1.145_amd64.deb

# 安装必要的依赖包
sudo apt install libqt5qml5 libqt5quick5 libqt5quickwidgets5 qml-module-qtquick2
sudo apt install libgsettings-qt1

# 修复可能的依赖关系问题
sudo apt install -f

第五步:解决显示问题(重要)

Ubuntu 24.04 默认使用 Wayland 显示服务器,可能导致搜狗输入法出现闪烁或无法正常显示的问题。需要强制使用 Xorg:

# 编辑 GDM 配置文件
sudo vim /etc/gdm3/custom.conf

# 找到以下行并取消注释(删除行首的 #):
# WaylandEnable=false

# 修改后应该是:
WaylandEnable=false

如果不熟悉 vim 编辑器,也可以使用图形化编辑器:

sudo gedit /etc/gdm3/custom.conf

第六步:重启系统

sudo reboot

第七步:配置输入法

重启后进行最终配置:

  1. 检查输入法状态
  • 右上角应该出现输入法图标(键盘或"搜"字样)
  • 如果没有,请继续下面的步骤
  1. 配置 Fcitx
    # 打开 Fcitx 配置工具 fcitx-configtool
    在配置界面中:
  • 点击左下角的 +
  • 取消勾选 Only Show Current Language
  • 搜索 sogou
  • 添加 Sogou Pinyin 到输入法列表
  1. 测试输入法
  • 使用 Ctrl + Space 切换输入法
  • 打开任意文本编辑器测试中文输入

常见问题及解决方案

问题1:输入法切换后闪烁

原因:Wayland 兼容性问题

解决方案:确保已按照第五步正确配置,强制使用 Xorg 显示服务器。

问题2:右上角没有输入法图标

解决方案

# 重启 Fcitx 服务
killall fcitx
fcitx &

# 或者重新登录系统

问题3:无法输入中文

检查步骤

  1. 确认语言支持已正确配置
  2. 检查是否在 Fcitx 配置中添加了搜狗输入法
  3. 尝试切换到其他应用程序测试

问题4:安装时提示依赖关系错误

解决方案

# 强制修复依赖关系
sudo apt --fix-broken install

# 重新安装
sudo dpkg -i sogoupinyin_4.2.1.145_amd64.deb

环境变量配置(可选)

如果在某些应用程序中无法使用中文输入法,可以添加以下环境变量:

# 编辑 .bashrc 文件
echo 'export GTK_IM_MODULE=fcitx' >> ~/.bashrc
echo 'export QT_IM_MODULE=fcitx' >> ~/.bashrc
echo 'export XMODIFIERS=@im=fcitx' >> ~/.bashrc

# 使配置生效
source ~/.bashrc

替代方案推荐

如果搜狗输入法仍然无法正常工作,推荐使用以下现代化的输入法方案:

方案一:Fcitx5 + Rime

sudo apt install fcitx5 fcitx5-rime fcitx5-chinese-addons
sudo apt install fcitx5-frontend-gtk4 fcitx5-frontend-gtk3 fcitx5-frontend-qt5

方案二:IBus 智能拼音

sudo apt install ibus-pinyin ibus-libpinyin

总结

通过以上步骤,你应该能够在 Ubuntu 24.04 上成功安装搜狗输入法。关键点包括:

  1. 框架降级:从 Fcitx5 降级到 Fcitx4
  2. 依赖安装:确保所有 Qt5 相关库正确安装
  3. 显示服务器:强制使用 Xorg 而非 Wayland
  4. 正确配置:通过图形界面和命令行正确配置输入法

如果遇到其他问题,建议查看官方安装向导:shurufa.sogou.com/linux


更新日期:2025年7月 适用版本:Ubuntu 24.04 LTS 测试状态:✅ 已验证可用

发布于 2025-07-04 00:30・浙江

03 July 2026

How to project Android phone screen to your ubuntu computer?

How to project Android phone screen to your ubuntu computer?
 
The easiest and most reliable way to project and control your Android screen on Ubuntu is using Scrcpy. It requires enabling USB Debugging on your phone, connecting with a USB cable, and running a simple command.
1. Enable Developer Options on Android
  1. Open your phone's Settings, go to About Phone (or System), and tap the Build Number 7 times.
  2. Go back to the main Settings menu, open Developer Options, scroll down, and toggle USB Debugging to ON.
2. Install Scrcpy on Ubuntu
Open your Ubuntu terminal (Ctrl+Alt+T) and install Scrcpy and the Android Debug Bridge (ADB) tool using the default package manager:
bash
sudo apt update
sudo apt install scrcpy adb -y
Use code with caution.
3. Connect and Mirror
  1. Plug your Android phone into your Ubuntu PC using a USB cable.
  2. A prompt will appear on your phone asking to authorize the computer. Select Always allow from this computer and tap Allow.
  3. In your Ubuntu terminal, simply type:
bash
scrcpy
Use code with caution.
A window will instantly pop up showing your phone's screen. You can now control your phone using your computer's mouse and keyboard.
For a quick visual breakdown of the installation and device setup steps:
For a quick visual breakdown of the installation and device setup steps:
If you want to project wirelessly instead of using a USB cable, let me know, and I can give you the steps to switch ADB to TCP/IP mode.
  • How to screen mirror android phone to Ubuntu PC? [duplicate]
    scrcpy for Mirroring: scrcpy allows screen mirroring and device control of Android devices on Ubuntu via USB or TCP/IP. The Androi...
    Ask Ubuntu
  • Mirror Android Phone To Ubuntu Desktop Using scrcpy 2.4
    When connecting your phone to the computer, check the 'always allow from this computer' option and then tap 'allow'.
    Related video thumbnail
    3m
    YouTube·joezomby1
  • Mirror Android Screen To Ubuntu 22.04 Desktop
    When connecting the phone to the computer, a popup will appear; select "always allow USB debugging" and then "allow".
    Related video thumbnail
    2m
    YouTube·joezomby1
Show all
 
Yes, I want to project wirelessly instead of using a USB cable, please.
 
To project your Android screen wirelessly using Scrcpy, your phone and Ubuntu computer must be connected to the same Wi-Fi network. You will still need a USB cable for the initial setup every time your phone restarts.
1. Enable Wireless ADB Mode
  1. Connect your phone to your Ubuntu PC with a USB cable.
  2. Open your terminal and find your phone's IP address by running:
    bash
    adb shell ip route | awk '{print $9}'
    
    Use code with caution.
    (Note down the IP address shown, for example: 192.168.1.50)
  3. Set the ADB connection mode to TCP/IP over port 5555:
    bash
    adb tcpip 5555
    
    Use code with caution.
2. Disconnect and Run Wirelessly
  1. Unplug the USB cable from your phone.
  2. Connect your PC to your phone over Wi-Fi using the IP address from earlier:
    bash
    adb connect 192.168.1.50:5555
    
    Use code with caution.
    (Replace 192.168.1.50 with your phone's actual IP address)
  3. Start mirroring your screen:
    bash
    scrcpy -e
    
    Use code with caution.
Troubleshooting Tip
If the video lags or stutters over your Wi-Fi, you can lower the bitrate and resolution by launching Scrcpy with this command instead:
bash
scrcpy --bit-rate 2M --max-size 1024
Use code with caution.
If you encounter any connection errors or want to learn how to automatically connect next time without typing the IP address, let me know!
  • Do I have to plug in the usb cable to activate wireless connection every time? · Issue #4198 · Genymobile/scrcpy
    Jul 28, 2023 — You must connect an USB cable only once after each phone reboot (you can't keep the TCP/IP mode across reboots without a rooted de...
    GitHub
  • How to Tether Any Smartphone to Linux for Mobile Internet
    Sep 14, 2023 — The methods described here require you to connect the mobile device to your PC with a working USB cable before activating tetherin...
    MakeUseOf
  • Connecting to Android Devices Over Wi-Fi in Android Studio
    Nov 30, 2024 — This guide will walk you through the steps required to set up ADB over Wi-Fi. Step-by-Step Guide 1. Enable Wireless Debugging To b...
    Repeato
Show all
AI Mode response is ready