解决 Ubuntu Linux 桌面无法打开应用的问题

2026-07-15 19:01:00
丁国栋
原创 20
摘要:解决 The SUID sandbox helper binary was found, but is not configured correctly 和 Maximum number of clients reached 的问题。

最近我打开 .deb 和 .AppImage 包管理器的应用总是无法打开,使用命令行运行得到以下错误:

./bruno_3.5.2_x86_64_linux.AppImage
[254451:0715/135503.732123:FATAL:sandbox/linux/suid/client/setuid_sandbox_host.cc:169] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_bruno_uNgs19/chrome-sandbox is owned by root and has mode 4755.
[1]    254451 trace trap (core dumped)  ./bruno_3.5.2_x86_64_linux.AppImage
./bruno_3.5.2_x86_64_linux.AppImage
Preferences file is located at: /home/guodong/.config/bruno/preferences.json
Maximum number of clients reached
[276323:0715/140130.568089:ERROR:ui/ozone/platform/x11/ozone_platform_x11.cc:250] Missing X server or $DISPLAY
[276323:0715/140130.568134:ERROR:ui/aura/env.cc:257] The platform failed to initialize.  Exiting.
[1]    276323 segmentation fault (core dumped)  ./bruno_3.5.2_x86_64_linux.AppImage

错误 ”The SUID sandbox helper binary was found, but is not configured correctly. “是由于 AppArmor 阻止了,可以去创建一个配置文件 /etc/apparmor.d/bruno-AppImage 来允许。

# This profile allows everything and only exists to give the
# application a name instead of having the label "unconfined"
abi <abi/4.0>,
include <tunables/global>
profile bruno-AppImage /home/guodong/Downloads/bruno_3.5.2_x86_64_linux.AppImage flags=(unconfined) {
  userns,
  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/bruno-AppImage>
}

错误“Maximum number of clients reached”,这个是我最近遇到比较多的。

这个错误并非每次都会遇到,例如刚登录系统时,这些冲突的应用都能正常打开,同时运行,但运行一段时间后,某个应用就无法打开了。由此可见确实是某些资源被占用了。

在这之前我也问过 AI,但是没有得到很好的解决。今天我用 Google 搜索,竟然得到了一个解决方法。

我搜索 “AppImage Maximum number of clients reached” 关键词,在 https://askubuntu.com/questions/681903/cannot-launch-apps-maximum-number-of-clients-reached 得到以下问答:

问:

Cannot launch apps - Maximum number of clients reached 

    Asked 10 years, 9 months ago Modified 2 years, 9 months ago Viewed 3k times 

答:

in another thread, this helpt me!

sudo ss -x src "*/tmp/.X11-unix/*" | grep -Eo "[0-9]+\s*$" | while read port
do sudo ss -p -x | grep -w $port | grep -v X11-unix
done | grep -Eo '".+"' | sort | uniq -c | sort -rn
  • ss is a tool to investigate sockets
  • sudo ss -x src "*/tmp/.X11-unix/*" lists to calls that are binded to x11.
  • grep... Then grapping the number of port
  • while read port means take the given port number and feed it to...
  • sudo ss -p -x | grep -w $port | grep -v X11-unix done which will grep these port binded to x11 giving the name of the process, and then
  • sort | uniq -c | sort -rn sorting them in decreasing order based on how many exists in a given socket of system.

A simplified version which shows the first 10 processes that have open the most sockets to the system.

sudo ss -p -x | grep -Eo '".+"' | sort | uniq -c | sort -rn | head -n 10

By knowing which process occupies the most sockets in the system, you can simply kill it. eg. killall process_name which will free sockets in your system to be used from other programs. The number of sockets in linux system are limited (but you can change its number - see links).

Related articles / bugs: here and here

于是,我执行了 sudo ss -x src "*/tmp/.X11-unix/*" | grep -Eo "[0-9]+\s*$" | while read port do sudo ss -p -x | grep -w $port | grep -v X11-unix done | grep -Eo '".+"' | sort | uniq -c | sort -rn,结果如下:

 234 "qq"
      5 "xuanxuan.bin"
      5 "WeChatAppEx"
      5 "termius-app"
      1 "wechat"
      1 "Snipaste"
      1 "mutter-x11-fram"
      1 "ibus-x11"
      1 "gsd-xsettings"
      1 "gnome-shell"

一共是 255 个(默认是255,好似不太容易调整)。我退出了 QQ 应用,发现确实可以正常打开其他应用了。

然后,我又启动了 QQ,重新执行了上面的命令,结果如下:

 6 "qq"
      5 "xuanxuan.bin"
      5 "WeChatAppEx"
      5 "termius-app"
      5 "bruno"
      1 "wechat"
      1 "Snipaste"
      1 "mutter-x11-fram"
      1 "ibus-x11"
      1 "gsd-xsettings"
      1 "gnome-shell"

有此可见,QQ 确实占用的比较多,应该是存在一些问题,这样后面就有办法处理了。

查看原始 X11 socket 列表:

sudo ss -x src "*/tmp/.X11-unix/*"

检查当前运行在图形界面上的客户端(list client applications running on a display)有哪些:

xlsclients -a
发表评论
博客分类