我在xubuntu24.04上面安装了 bleachbit,选择清除了APT、dEEP SCAN中的...
Creado el: 26 de marzo de 2026
Creado el: 26 de marzo de 2026
我在xubuntu24.04上面安装了 bleachbit,选择清除了APT、dEEP SCAN中的teMPORARY FILES、System中的全部执行后,我的IDEA 无法使用fcitx5打出中文了,在浏览器或者 word中是可以打出中文的,xubuntu使用的是xfce桌面.我的电脑在使用bleachbit之前在IDEA中是可以打出中文的
这个问题基本可以确定是 BleachBit 清理时误删了 fcitx5 或输入法相关的缓存 / 配置 / 环境变量依赖,而 IDEA(JetBrains 系列)对输入法支持本来就比较“挑环境”,所以只在 IDEA 里失效。
你现在的情况是:
下面按“从最可能 → 最彻底”的顺序帮你排查👇
在终端执行:
bashecho $GTK_IM_MODULE echo $QT_IM_MODULE echo $XMODIFIERS
正常应该是:
textGTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx
编辑:
bashnano ~/.xprofile
写入:
bashexport GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx
然后执行:
bashsource ~/.xprofile
👉 重启系统(必须)
启动 IDEA 后,在终端执行:
bashps aux | grep idea
找到进程 PID,然后:
bashcat /proc/进程ID/environ | tr '\0' '\n' | grep IM
👉 如果这里没有 fcitx 相关变量
说明 IDEA 启动时没加载输入法环境(非常常见)
重新安装一遍输入法组件:
bashsudo apt install --reinstall \ fcitx5 \ fcitx5-configtool \ fcitx5-frontend-gtk3 \ fcitx5-frontend-qt5 \ fcitx5-module-xorg \ fcitx5-chinese-addons
JetBrains IDE 在 Linux 上需要额外支持:
bashsudo apt install fcitx5-frontend-qt5 fcitx5-frontend-qt6
Toolbox 启动不会继承系统环境变量!
修改启动脚本:
bashnano ~/.local/share/JetBrains/Toolbox/scripts/idea.sh
在最前面加:
bashexport GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx
JetBrains 有时候更兼容 ibus:
bashexport GTK_IM_MODULE=ibus export QT_IM_MODULE=ibus export XMODIFIERS=@im=ibus
(但一般 fcitx5 + qt 插件就够了)
bashfcitx5-diagnose
重点看:
用终端启动 IDEA(很关键):
bashGTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx idea.sh
👉 如果这样能输入中文
说明问题 100% 是环境变量丢失
BleachBit 的这些选项很危险:
/tmp 运行时 socket)👉 fcitx5 依赖:
这些被删后:
👉 普通应用自动恢复
👉 IDEA 不会(它对输入法支持不标准)
直接执行这一套👇
bashsudo apt install --reinstall fcitx5* nano ~/.xprofile
写入:
bashexport GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=@im=fcitx
然后:
bashreboot
你可以把下面信息发我,我可以帮你精准定位:
bashecho $XDG_SESSION_TYPE echo $DESKTOP_SESSION fcitx5-diagnose
还有你 IDEA 是:
👉 不同安装方式解决方案会不一样 👍
我的IDEA是官方 tar.gz,,已经执行你推荐的修复方式
randy@randy-CP300Z3:~XDG_SESSION_TYPE
echo $DESKTOP_SESSION
fcitx5-diagnose
x11
xubuntu
uname -a:
Linux randy-CP300Z3 6.14.0-37-generic #37~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 20 10:25:38 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a:
textDistributor ID: Ubuntu Description: Ubuntu 24.04.3 LTS Release: 24.04 Codename: noble
lsb_release -d:
Description: Ubuntu 24.04.3 LTS
/etc/lsb-release:
textDISTRIB_ID=Ubuntu DISTRIB_RELEASE=24.04 DISTRIB_CODENAME=noble DISTRIB_DESCRIPTION="Ubuntu 24.04.3 LTS"
/etc/os-release:
textPRETTY_NAME="Ubuntu 24.04.3 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.3 LTS (Noble Numbat)" VERSION_CODENAME=noble ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=noble LOGO=ubuntu-logo
Desktop Environment:
Desktop environment is xfce.
XDG SESSION TYPE:
XDG_SESSION_TYPE='x11'
Bash Version:
BASH_VERSION='5.2.21(1)-release'
DISPLAY:
textDISPLAY=':0.0' WAYLAND_DISPLAY=''
Keyboard Layout:
setxkbmap:
textxkb_keymap { xkb_keycodes { include "evdev+aliases(qwerty)" }; xkb_types { include "complete" }; xkb_compat { include "complete" }; xkb_symbols { include "pc+cn+inet(evdev)" }; xkb_geometry { include "pc(pc105)" }; };
xprop:
_XKB_RULES_NAMES(STRING) = "evdev", "pc105", "cn", "", ""
Locale:
All locales:
textC C.utf8 en_AG en_AG.utf8 en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8 en_IE.utf8 en_IL en_IL.utf8 en_IN en_IN.utf8 en_NG en_NG.utf8 en_NZ.utf8 en_PH.utf8 en_SG.utf8 en_US.utf8 en_ZA.utf8 en_ZM en_ZM.utf8 en_ZW.utf8 POSIX zh_CN.utf8 zh_SG.utf8
Current locale:
textLANG=zh_CN.UTF-8 LANGUAGE=zh_CN LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=
Directories:
Home:
/home/randy
${XDG_CONFIG_HOME}:
Environment variable XDG_CONFIG_HOME is not set.
Current value of XDG_CONFIG_HOME is ~/.config (/home/randy/.config).
Fcitx5 Settings Directory:
Current fcitx5 settings directory is ~/.config/fcitx5 (/home/randy/.config/fcitx5).
Current user:
The script is run as randy (1000).
executable:
Found fcitx5 at /usr/bin/fcitx5.
version:
Fcitx version: 5.1.7
process:
Found 1 fcitx5 process:
2548 fcitx5
fcitx5-remote:
fcitx5-remote works properly.
DBus interface:
Using dbus-send to check dbus.
Owner of DBus name org.fcitx.Fcitx5 is :1.43.
PID of DBus name org.fcitx.Fcitx5 owner is 2548.
Debug information from dbus:
textGroup [x11::0.0] has 5 InputContext(s) IC [1831f82f90c34d2db42d761c9e0915f7] program:xfce4-terminal frontend:dbus cap:6000000032 focus:1 IC [467aaa4c0a964d9ba34b421df5b00fc2] program:xfce4-terminal frontend:dbus cap:6000000032 focus:0 IC [d874e25a10084118aca2b374e0b1a14f] program:firefox frontend:fcitx4 cap:12 focus:0 IC [b204d75e09784334822bb82426e484b9] program:firefox frontend:fcitx4 cap:52 focus:0 IC [6f701c7a170e4799ba4c0e04ad2e027f] program:wrapper-2.0 frontend:dbus cap:6000000072 focus:0 Input Context without group
Config Tool Wrapper:
Found fcitx5-configtool at /usr/bin/fcitx5-configtool.
Config GUI for qt:
Found fcitx5-config-qt at /usr/bin/fcitx5-config-qt.
Config GUI for kde:
kcmshell5 not found.
The environment variable checked by this script only shows the environment under current shell. It is still possible that you did not set the environment to the whole graphic desktop session. You may inspect the actual environment variable of a certain process by using xargs -0 -L1 /proc/$PID/environ for a certain process that you find not working.
${XMODIFIERS}:
Environment variable XMODIFIERS is set to "@im=fcitx" correctly.
Xim Server Name from Environment variable is fcitx.
XIM_SERVERS on root window:
Xim server name is the same with that set in the environment variable.
qt4 - ${QT4_IM_MODULE}:
Environment variable QT_IM_MODULE is set to "fcitx" correctly.
fcitx5-qt4-immodule-probing not found.
qt5 - ${QT_IM_MODULE}:
Environment variable QT_IM_MODULE is set to "fcitx" correctly.
Using fcitx5-qt5-immodule-probing to check the actual im module to be used under current environment:
textQT_QPA_PLATFORM=xcb QT_IM_MODULE=fcitx IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
qt6 - ${QT_IM_MODULE}:
Environment variable QT_IM_MODULE is set to "fcitx" correctly.
Using fcitx5-qt6-immodule-probing to check the actual im module to be used under current environment:
textQT_QPA_PLATFORM=xcb QT_IM_MODULE=fcitx IM_MODULE_CLASSNAME=fcitx::QFcitxPlatformInputContext
Qt IM module files:
Found fcitx5 im module for qt6: /lib/x86_64-linux-gnu/qt6/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so.
Found fcitx5 qt6 module: /lib/x86_64-linux-gnu/fcitx5/qt6/libfcitx-quickphrase-editor5.so.
Found fcitx5 im module for qt5: /lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitx5platforminputcontextplugin.so.
Following error may not be accurate because guessing Qt version from path depends on how your distribution packages Qt. It is not a critical error if you do not use any Qt application with certain version of Qt or you are using text-input support by Qt under Wayland.
Cannot find fcitx5 input method module for Qt4.
gtk - ${GTK_IM_MODULE}:
Environment variable GTK_IM_MODULE is set to "fcitx" correctly.
Using fcitx5-gtk2-immodule-probing to check the actual im module to be used under current environment:
GTK_IM_MODULE=fcitx
Using fcitx5-gtk3-immodule-probing to check the actual im module to be used under current environment:
GTK_IM_MODULE=fcitx
Using fcitx5-gtk4-immodule-probing to check the actual im module to be used under current environment:
GTK_IM_MODULE=fcitx
gtk-query-immodules:
gtk 2:
Cannot find gtk-query-immodules for gtk 2
Cannot find fcitx5 im module for gtk 2.
gtk 3:
Cannot find gtk-query-immodules for gtk 3
Cannot find fcitx5 im module for gtk 3.
Gtk IM module cache:
gtk 2:
Found immodules cache for gtk 2.24.33 at /lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache.
Version Line:
# Created by /usr/lib/x86_64-linux-gnu/libgtk2.0-0t64/gtk-query-immodules-2.0 from gtk+-2.24.33
Found fcitx5 im modules for gtk 2.24.33.
text"/usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules/im-fcitx5.so" "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*"
gtk 3:
Found immodules cache for gtk 3.24.41 at /lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache.
Version Line:
# Created by /usr/lib/x86_64-linux-gnu/libgtk-3-0t64/gtk-query-immodules-3.0 from gtk+-3.24.41
Found fcitx5 im modules for gtk 3.24.41.
text"/usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules/im-fcitx5.so" "fcitx" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*" "fcitx5" "Fcitx5 (Flexible Input Method Framework5)" "fcitx5" "/usr/locale" "ja:ko:zh:*"
Gtk IM module files:
gtk 2:
All found Gtk 2 immodule files exist.
gtk 3:
All found Gtk 3 immodule files exist.
gtk 4:
All found Gtk 4 immodule files exist.
Addon Config Dir:
Found fcitx5 addon config directory: /usr/share/fcitx5/addon.
Addon List:
Found 29 enabled addons:
textSimplified and Traditional Chinese Translation 5.1.3 Classic User Interface 5.1.7 Clipboard 5.1.7 Cloud Pinyin 5.1.3 DBus 5.1.7 DBus Frontend 5.1.7 Emoji 5.1.7 Fcitx4 Frontend 5.1.7 Full width character 5.1.3 IBus Frontend 5.1.7 Lua IME API 5.0.12 Input method selector 5.1.7 Keyboard 5.1.7 KDE Input Method Panel 5.1.7 Lua Addon Loader 5.0.12 Status Notifier 5.1.7 Notification 5.1.7 Pinyin 5.1.3 Extra Pinyin functionality 5.1.3 Punctuation 5.1.3 Quick Phrase 5.1.7 Spell 5.1.7 Table 5.1.3 Unicode 5.1.7 DBus Virtual Keyboard 5.1.7 Wayland 5.1.7 Wayland Input method frontend 5.1.7 XCB 5.1.7 X Input Method Frontend 5.1.7
Found 0 disabled addons:
Addon Libraries:
All libraries for all addons are found.
User Interface:
Found 3 enabled user interface addons:
textClassic User Interface KDE Input Method Panel DBus Virtual Keyboard
/home/randy/.config/fcitx5/profile:
text[Groups/0] # Group Name Name=Default # Layout Default Layout=cn # Default Input Method DefaultIM=wbpy [Groups/0/Items/0] # Name Name=keyboard-cn # Layout Layout= [Groups/0/Items/1] # Name Name=wbpy # Layout Layout= [GroupOrder] 0=Default
date:
2026年 03月 26日 星期四 16:29:32 CST
/home/randy/.config/fcitx5/crash.log:
/home/randy/.config/fcitx5/crash.log not found.
Warning: the output of fcitx5-diagnose contains sensitive information, including the distribution name, kernel version, name of currently running programs, etc.
Though such information can be helpful to developers for diagnostic purpose, please double check and remove as necessary before posting it online publicly.
从你这份 fcitx5-diagnose 看,fcitx5 本身是正常的,环境变量也正确,Qt/GTK 的输入法模块都在。关键异常点是:
firefox、xfce4-terminal 都有 InputContext这说明不是 fcitx5 坏了,而是 IDEA 这个进程没有真正接入 fcitx。JetBrains 官方对 Linux + Fcitx 的说明也明确提到:在 X11 下必须让 IDE 进程拿到 GTK_IM_MODULE=fcitx、QT_IM_MODULE=fcitx、XMODIFIERS=@im=fcitx 这几个环境变量;同时,JetBrains 近期仍有 fcitx5 在 Linux 上失效的已知问题记录。(YouTrack)
你现在最像是这两类问题之一:
下面按最有效的顺序修。
你的诊断结果已经足够说明:
不要先点桌面图标。先在终端里进入 IDEA 的 bin 目录启动:
bashcd /你的/idea安装目录/bin env GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx ./idea.sh
然后在 IDEA 编辑器里测试中文输入。
启动 IDEA 后,执行:
bashps -ef | grep -i '[i]dea'
找到 IDEA 的 PID 后执行:
bashtr '\0' '\n' < /proc/PID/environ | grep -E '^(GTK_IM_MODULE|QT_IM_MODULE|XMODIFIERS)='
正常应该看到:
bashGTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx
官方 tar.gz 常见情况是你后来创建了一个 .desktop 启动项,但这个启动项不一定带环境。
先找桌面文件:
bashgrep -R "idea.sh" ~/.local/share/applications /usr/share/applications 2>/dev/null
通常会看到类似:
bash~/.local/share/applications/jetbrains-idea.desktop
编辑它:
bashnano ~/.local/share/applications/jetbrains-idea.desktop
把 Exec= 改成这样:
iniExec=env GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx /你的/idea安装目录/bin/idea.sh %f
保存后刷新:
bashupdate-desktop-database ~/.local/share/applications
然后退出 IDEA,重新从菜单启动测试。
JetBrains 有过“把输入法支持禁用后不明显提示如何恢复”的问题记录。(YouTrack)
BleachBit 清理后,最值得怀疑的是 用户配置目录 有异常。
先备份再重置当前版本配置。执行前先关掉 IDEA:
bashmv ~/.config/JetBrains ~/.config/JetBrains.bak.$(date +%F-%H%M%S) mv ~/.cache/JetBrains ~/.cache/JetBrains.bak.$(date +%F-%H%M%S) mv ~/.local/share/JetBrains ~/.local/share/JetBrains.bak.$(date +%F-%H%M%S)
然后重新启动 IDEA 测试。
这一步会让 IDEA 像“第一次启动”那样重新生成配置。
如果这样恢复了中文输入,说明就是 JetBrains 配置被 BleachBit 清坏了。
JetBrains 在 Linux/Fcitx 上一直有兼容性问题,常见的补救方式是给 VM options 加一项。JetBrains 官方也承认 Linux 上 Fcitx/Fcitx5 存在持续问题。(YouTrack)
在 IDEA 的自定义 VM options 文件里加入:
text-Drecreate.x11.input.method=true
如果你还没建过这个文件,可以直接在安装目录测试。编辑:
bashnano /你的/idea安装目录/bin/idea64.vmoptions
在最后加:
text-Drecreate.x11.input.method=true
保存后重启 IDEA。
这个参数在部分版本上能修,在少数场景也可能引出键盘异常,所以它是“测试项”,不是绝对长期方案。JetBrains 那边也有相关问题记录。(YouTrack)
在终端执行:
bash/你的/idea安装目录/bin/idea.sh | head
或者进入 IDEA 的 Help → About 看 Runtime version。
你要确认两件事:
如果你之前改过 IDEA_JDK、JDK_HOME、JAVA_HOME,先临时清掉再试:
bashunset IDEA_JDK unset JDK_HOME unset JAVA_HOME env GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx /你的/idea安装目录/bin/idea.sh
因为你是 tar.gz 安装,最省事的修复之一是:
env ... ./idea.sh 方式先启动测试JetBrains 官方到现在仍在维护 Linux/Fcitx 相关问题;如果是 JBR 本身状态异常,直接换一份完整安装比在旧目录里修更快。(YouTrack)
按命中率排序:
bashcd /你的/idea安装目录/bin env GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx ./idea.sh
bashmv ~/.config/JetBrains ~/.config/JetBrains.bak.$(date +%F-%H%M%S) mv ~/.cache/JetBrains ~/.cache/JetBrains.bak.$(date +%F-%H%M%S) mv ~/.local/share/JetBrains ~/.local/share/JetBrains.bak.$(date +%F-%H%M%S)
因为你的 fcitx5-diagnose 已经显示:
但 唯独没有 IDEA 的输入上下文。这基本已经把问题收敛到 “IDEA 进程自身” 了。
把这三条命令的结果发我,我可以直接帮你判断是哪一类,不用你再自己猜:
bashps -ef | grep -i '[i]dea' tr '\0' '\n' < /proc/上面那个PID/environ | grep -E '^(GTK_IM_MODULE|QT_IM_MODULE|XMODIFIERS|JAVA_HOME|IDEA_JDK)=' grep -R "Exec=.*idea" ~/.local/share/applications /usr/share/applications 2>/dev/null