N0r*_*ert 5 sudo qt kubuntu pkexec 20.04
之前有人告诉我们,用它sudo
来启动基于 GUI 的应用程序是个坏主意。
所以应该使用pkexec
。
我记得它,所以我尝试使用终端在 Kubuntu 20.04 LTS 上启动 Kubuntu 驱动程序管理器
pkexec kubuntu-driver-manager
Run Code Online (Sandbox Code Playgroud)
但这个命令不起作用,它崩溃并显示以下输出:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: wayland-org.kde.kwin.qpa, dxcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.
Aborted (core dumped)
Run Code Online (Sandbox Code Playgroud)
我最近报告了错误 1885615。但我对这种行为感到非常惊讶。有趣的sudo kubuntu-driver-manager
事情通常都会发生。
我仍然可以使用 - 命令在 Kubuntu 上启动基于 Gtk 的应用程序,pkexec
例如使用rootpkexec pluma
权限打开应用程序的结果。
所以我的问题就在标题中。
实际上,可以使用某种hackpkexec
来代替在没有特定 PolicyKit .policysudo
文件的情况下启动应用程序。我们需要指定丢失的环境变量,如下所示:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY kubuntu-driver-manager
Run Code Online (Sandbox Code Playgroud)
经过实验,我发现它只需要一个/usr/share/polkit-1/actions/org.freedesktop.policykit.policy
文件即可运行。
归档时间: |
|
查看次数: |
2176 次 |
最近记录: |