首页 最新 热门 推荐

  • 首页
  • 最新
  • 热门
  • 推荐

解决WSL2中Ubuntu-22.04找不到bus的错误项目场景:问题描述原因分析:解决方案:总结:

  • 23-09-04 17:21
  • 4278
  • 8819
blog.csdn.net

项目场景:

对于systemd系统来说,DBUS是必不可少的工具,它是进程间通讯的桥梁。


问题描述

当我们在WSL2中安装QQ音乐的时候,打开崩溃,具体的提示错误是:Failed to connect to the bus: Failed to connect to socket /run/user/1000/bus: No such file or directory

意思就是没有/run/user/1000/bus这个文件,我们去这个目录下面确实没找到这个文件。

ls /run/user/1000/
dbus-1  gnupg  pk-debconf-socket  pulse  snapd-session-agent.socket  systemd  wayland-0  wayland-0.lock
  • 1
  • 2

简单解释下:
1000是除了root用户外你创建的第一个用户ID,第二个ID是1001。

有些软件可能能够运行,但是像QQ音乐Linux版,没有这个文件就直接崩溃或不出声音。


原因分析:

DBUS简单理解就是用于处理进程间通讯的桥梁,用来在不同的Applications中相互传递消息。它的效率很高,很多发行版中都集成了。

有些Applications依赖这个东西,如果没有的话就不能正常运行。废话不多说,由于DBUS很复杂,有兴趣的可以自行搜索学习下。这里,我只说解决方法。


解决方案:

其实是缺少了一个包,我们搜索dbus看下就明白了。

dpkg -l | grep dbus
ii  at-spi2-core                         2.44.0-3                                amd64        Assistive Technology Service Provider Interface (dbus core)
ii  dbus                                 1.12.20-2ubuntu4.1                      amd64        simple interprocess messaging system (daemon and utilities)
ii  dbus-x11                             1.12.20-2ubuntu4.1                      amd64        simple interprocess messaging system (X11 deps)
ii  libdbus-1-3:amd64                    1.12.20-2ubuntu4.1                      amd64        simple interprocess messaging system (library)
ii  libdbusmenu-glib4:amd64              16.04.1+18.10.20180917-0ubuntu8         amd64        library for passing menus over DBus
ii  libdbusmenu-gtk3-4:amd64             16.04.1+18.10.20180917-0ubuntu8         amd64        library for passing menus over DBus - GTK+ version
ii  libnet-dbus-perl                     1.2.0-1build3                           amd64        Perl extension for the DBus bindings
ii  python3-dbus                         1.2.18-3build1                          amd64        simple interprocess messaging system (Python 3 interface)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

这里少了一个包dbus-user-session,装上这个包就不会报错了。

sudo apt install dbus-user-session
  • 1

我们看下这个包的描述信息,重点看Description:

apt info dbus-user-session

Package: dbus-user-session
Version: 1.12.20-2ubuntu4.1
Priority: optional
Section: admin
Source: dbus
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Utopia Maintenance Team <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 133 kB
Provides: dbus-session-bus, default-dbus-session-bus
Depends: dbus (>= 1.12.20-2ubuntu4.1), libpam-systemd, systemd
Recommends: systemd-sysv
Breaks: dbus-x11 (<< 1.9.10-2~), policykit-1 (<< 0.105-12~), udisks2 (<< 2.1.5-2~)
Homepage: https://dbus.freedesktop.org/
Task: server-minimal, print-server, ubuntu-desktop-minimal, ubuntu-desktop, cloud-image, ubuntu-desktop-raspi, ubuntu-desktop-raspi, server, ubuntu-server-raspi, ubuntu-server-raspi, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-budgie-desktop-raspi
Download-Size: 9442 B
APT-Manual-Installed: yes
APT-Sources: http://mirrors.aliyun.com/ubuntu jammy-security/main amd64 Packages
Description: simple interprocess messaging system (systemd --user integration)
 D-Bus is a message bus, used for sending messages between applications.
 Conceptually, it fits somewhere in between raw sockets and CORBA in
 terms of complexity.
 .
 On systemd systems, this package opts in to the session model in which
 a user's session starts the first time they log in, and does not end
 until all their login sessions have ended. This model merges all
 parallel non-graphical login sessions (text mode, ssh, cron, etc.), and up
 to one graphical session, into a single "user-session" or "super-session"
 within which all background D-Bus services are shared.
 .
 Multiple graphical sessions per user are not currently supported in this
 mode; as a result, it is particularly suitable for gdm, which responds to
 requests to open a parallel graphical session by switching to the existing
 graphical session and unlocking it.
 .
 To retain dbus' traditional session semantics, in which login sessions
 are artificially isolated from each other, remove this package and install
 dbus-x11 instead.
 .
 See the dbus package description for more information about D-Bus in general.

N: There is 1 additional record. Please use the '-a' switch to see it
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45

简单解释下:
意思就是这个东西是用来进程间通信的消息库,这个是依赖systemd系统的,在用户第一次登录进来开始一个会话,直到所有的登录会话都结束它才结束。

总结:

对于必须依赖这个包的程序有用,能正常运行的可以不装。

文章知识点与官方知识档案匹配,可进一步学习相关知识
云原生入门技能树首页概览14761 人正在系统学习中
注:本文转载自blog.csdn.net的洛克希德马丁的文章"https://blog.csdn.net/jiexijihe945/article/details/132314886"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
复制链接
复制链接
相关推荐
发表评论
登录后才能发表评论和回复 注册

/ 登录

评论记录:

未查询到任何数据!
回复评论:

分类栏目

后端 (14832) 前端 (14280) 移动开发 (3760) 编程语言 (3851) Java (3904) Python (3298) 人工智能 (10119) AIGC (2810) 大数据 (3499) 数据库 (3945) 数据结构与算法 (3757) 音视频 (2669) 云原生 (3145) 云平台 (2965) 前沿技术 (2993) 开源 (2160) 小程序 (2860) 运维 (2533) 服务器 (2698) 操作系统 (2325) 硬件开发 (2492) 嵌入式 (2955) 微软技术 (2769) 软件工程 (2056) 测试 (2865) 网络空间安全 (2948) 网络与通信 (2797) 用户体验设计 (2592) 学习和成长 (2593) 搜索 (2744) 开发工具 (7108) 游戏 (2829) HarmonyOS (2935) 区块链 (2782) 数学 (3112) 3C硬件 (2759) 资讯 (2909) Android (4709) iOS (1850) 代码人生 (3043) 阅读 (2841)

热门文章

101
推荐
关于我们 隐私政策 免责声明 联系我们
Copyright © 2020-2025 蚁人论坛 (iYenn.com) All Rights Reserved.
Scroll to Top