AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

全部问题(ubuntu)

Martin Hope
Syfer Polski
Asked: 2025-03-08 19:33:00 +0800 CST

如何报告 Ubuntu 默认浏览器中的错误?

  • 5

https://help.ubuntu.com/community/ReportingBugs建议使用ubuntu-bug buggy-package-name来报告错误。但是,就我而言,默认浏览器 Firefox 受到该错误的影响,在打开时崩溃。

我如何覆盖ubuntu-bug启动哪个浏览器来完成错误报告?Chrome 可以正常工作,我正在用它写这篇文章。我不想永久更改默认浏览器,直到问题解决为止。我在 Kubuntu 上运行 Wayland 会话(尝试返回 X11,但错误仍然存​​在)

firefox
  • 1 个回答
  • 36 Views
Martin Hope
quill
Asked: 2025-03-08 09:31:35 +0800 CST

ocrmypdf 在 24.04 上失败并出现 python 错误

  • 6

在 24.04 上,某些 ID 无法运行 ocrmypdf。例外是执行 sudo apt install ocrmypdf 的 ID,它运行正常。运行 sudo ocrmypdf 也有效。为什么除了执行 sudo apt install 的 ID 之外,其他 ID 都无法运行?22.04 系统上的所有 ID 都可以运行 ocrmypdf。

表示失败的文本字符串如下:

An exception occurred while executing the pipeline                  _sync.py:473
Traceback (most recent call last):                                              
  File "/usr/lib/python3/dist-packages/ocrmypdf/_sync.py", line                 
409, in run_pipeline                                                            
    optimize_messages = exec_concurrent(context, executor)                      
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                      
  File "/usr/lib/python3/dist-packages/ocrmypdf/_sync.py", line                 
315, in exec_concurrent                                                         
    pdf, messages = post_process(pdf, context, executor)                        
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                        
  File "/usr/lib/python3/dist-packages/ocrmypdf/_sync.py", line                 
247, in post_process                                                            
    return optimize_pdf(pdf_out, context, executor)                             
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                             
  File "/usr/lib/python3/dist-packages/ocrmypdf/_pipeline.py", line             
1009, in optimize_pdf                                                           
    output_pdf, messages =                                                      
context.plugin_manager.hook.optimize_pdf(                                       
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             
^                                                                               
  File "/usr/lib/python3/dist-packages/pluggy/_hooks.py", line 501,             
in __call__                                                                     
    return self._hookexec(self.name, self._hookimpls.copy(),                    
kwargs, firstresult)                                                            
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             
^^^^^^^^^^^^^^                                                                  
  File "/usr/lib/python3/dist-packages/pluggy/_manager.py", line                
119, in _hookexec                                                               
    return self._inner_hookexec(hook_name, methods, kwargs,                     
firstresult)                                                                    
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             
^^^^^                                                                           
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line                
138, in _multicall                                                              
    raise exception.with_traceback(exception.__traceback__)                     
  File "/usr/lib/python3/dist-packages/pluggy/_callers.py", line                
102, in _multicall                                                              
    res = hook_impl.function(*args)                                             
          ^^^^^^^^^^^^^^^^^^^^^^^^^                                             
  File                                                                          
"/usr/lib/python3/dist-packages/ocrmypdf/builtin_plugins/optimize.p             
y", line 151, in optimize_pdf                                                   
    'jbig2': jbig2enc.available(),                                              
             ^^^^^^^^^^^^^^^^^^^^                                               
  File "/usr/lib/python3/dist-packages/ocrmypdf/_exec/jbig2enc.py",             
line 22, in available                                                           
    version()                                                                   
  File "/usr/lib/python3/dist-packages/ocrmypdf/_exec/jbig2enc.py",             
line 17, in version                                                             
    return Version(get_version('jbig2', regex=r'jbig2enc                        
(\d+(\.\d+)*).*'))                                                              
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             
^^^^^^^                                                                         
  File                                                                          
"/usr/lib/python3/dist-packages/ocrmypdf/subprocess/__init__.py",               
line 159, in get_version                                                        
    proc = run(                                                                 
           ^^^^                                                                 
  File                                                                          
"/usr/lib/python3/dist-packages/ocrmypdf/subprocess/__init__.py",               
line 63, in run                                                                 
    proc = subprocess_run(args, env=env, check=check, **kwargs)                 
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
  File "/usr/lib/python3.12/subprocess.py", line 548, in run                    
    with Popen(*popenargs, **kwargs) as process:                                
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^                                            
  File "/usr/lib/python3.12/subprocess.py", line 1026, in __init__              
    self._execute_child(args, executable, preexec_fn, close_fds,                
  File "/usr/lib/python3.12/subprocess.py", line 1955, in                       
_execute_child                                                                  
    raise child_exception_type(errno_num, err_msg, err_filename)                
PermissionError: [Errno 13] Permission denied: 'jbig2'
python
  • 1 个回答
  • 90 Views
Martin Hope
voluntubuntu
Asked: 2025-03-08 04:24:54 +0800 CST

删除 Wine 后 Wine 应用程序不会消失

  • 9

我一直在使用 wine,但效果不太好所以我将其删除了。

之后 Wine 的 7-zip 仍然存在于gnome-menus(应用程序菜单)我该如何解决这个问题

我已从存储库中删除wine安装。我已从自己的存储库中main删除winehq-stablewinehq

如果我输入sudo apt-get remove --purge wine winehq-stable 它说:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'wine' is not installed, so not removed
Package 'winehq-stable' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我该如何修复它?

apt
  • 2 个回答
  • 375 Views
Martin Hope
Jurakin
Asked: 2025-03-08 02:51:30 +0800 CST

使用自定义加密根和交换分区安装 Ubuntu

  • 5

我想使用自定义分区设置安装 Ubuntu 22.04 LTS,包括一个加密的根分区和一个 8 GiB 的交换分区。默认的 Ubuntu 安装程序不允许我设置自定义交换大小。我该怎么做才能实现这一点?

partitioning
  • 1 个回答
  • 36 Views
Martin Hope
Thanasis Mattas
Asked: 2025-03-07 23:51:00 +0800 CST

snap 找不到 libxcb.so.1

  • 6
$ snap list
snap: error while loading shared libraries: libxcb.so.1: cannot open shared object file: No such file or directory
$ whereis libxcb.so.1
libxcb.so.1: /usr/lib/x86_64-linux-gnu/libxcb.so.1
$ which snap
/usr/bin/snap
$ sha256sum /bin/snap
06d498c41a5bf2f4d836fb50ff02749c82297fd3e74e41d78bb089292158be5a  /bin/snap
$ file /bin/snap
/bin/snap: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, Go BuildID=_XiLSmroeRJA5Uo8zvaX/rt3gXAZzIqOiI-Q_dmRd/7eHWjLhhkgUrQ7Kb9WkR/V-DYZbbtce--vU_MTNt2, stripped
$ strace -o trace.out /usr/bin/snap list
$ grep -C5 'libxcb.so.1' trace.out
mmap(NULL, 1297704, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee906c3000
mmap(0x7fee906dc000, 589824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x7fee906dc000
mmap(0x7fee9076c000, 585728, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa9000) = 0x7fee9076c000
mmap(0x7fee907fb000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x138000) = 0x7fee907fb000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/cuda/include/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/cuda/lib64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v3/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "glibc-hwcaps/x86-64-v2/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=170600, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fee90b5b000
mmap(NULL, 172680, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fee90b30000
mmap(0x7fee90b3c000, 81920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x7fee90b3c000
--
mmap(NULL, 1297704, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7bdda3e93000
mmap(0x7bdda3eac000, 589824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0x7bdda3eac000
mmap(0x7bdda3f3c000, 585728, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa9000) = 0x7bdda3f3c000
mmap(0x7bdda3fcb000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x138000) = 0x7bdda3fcb000
close(3)                                = 0
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/x86_64-linux-gnu/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/glibc-hwcaps/x86-64-v3/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/glibc-hwcaps/x86-64-v3", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/glibc-hwcaps/x86-64-v2/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/glibc-hwcaps/x86-64-v2", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/haswell/x86_64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/haswell/x86_64", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/haswell/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/haswell", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/x86_64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/x86_64", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/tls", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/haswell/x86_64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/haswell/x86_64", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/haswell/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/haswell", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/x86_64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib/x86_64", 0x7ffc475173a0, 0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/snap/snapd/current/usr/lib/libxcb.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/snap/snapd/current/usr/lib", {st_mode=S_IFDIR|0755, st_size=130, ...}, 0) = 0
writev(2, [{iov_base="/usr/bin/snap", iov_len=13}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libxcb.so.1", iov_len=11}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="No such file or directory", iov_len=25}, {iov_base="\n", iov_len=1}], 10) = 124
exit_group(127)                         = ?
+++ exited with 127 +++


已经尝试重新安装:

sudo apt install --reinstall snapd && sudo snap refresh

但无济于事。

Ubuntu 24.10

有什么想法吗?

snap
  • 1 个回答
  • 138 Views
Martin Hope
reducing activity
Asked: 2025-03-07 20:28:02 +0800 CST

我该如何修复 QGIS 徽标而不是照片缩略图的问题?

  • 6

在此处输入图片描述

知道为什么某些 .jpg 会以 QGIS 形式显示缩略图吗?如何修复?

我正在使用 PCManFM-Qt 1.4.1,在 Lubuntu 20.04 上也遇到过类似的问题。在全新安装的 Lubuntu 24.04 上仍然出现此问题。

我已经设置了默认打开程序,它工作正常, qgis 中的file --mime-type IMG_20250302_093435.jpg显示仅在 我删除的下,以防万一 显示有条目- 不知道它是否表示有什么不好image/jpeg~/.config/mimeapps.listapplication/geo+json=org.qgis.qgis.desktop; and application/json=org.qgis.qgis.desktop;/home/mateusz/.cache/thumbnailsxdg-mime query default image/jpegorg.gnome.eog.desktop exiftool IMG_20250302_093435.jpgThumbnail Image : (Binary data 49792 bytes, use -b option to extract)

exiftool -b -ThumbnailImage IMG_20250302_093435.jpg > extracted_thumbnail.jpg提取 100% 精细图像


我没有禁用缩略图。

在此处输入图片描述

lubuntu
  • 1 个回答
  • 118 Views
Martin Hope
User051209
Asked: 2025-03-06 22:42:32 +0800 CST

如果在 lubuntu 24.04 的安装过程中没有创建 EFI 分区,系统可以启动吗?[重复]

  • 5
这个问题已经有答案了:
efi/esp 分区是什么? (1 个回答)
3 小时前关闭。

EFI我最近在一张完全空的微型 SD 卡上安装了 lubuntu 24.04。安装程序要求我执行手动分区,在此阶段,它建议我创建具有以下特征的分区非常重要:

  • 分区的文件系统必须是 FAT32
  • 大小必须至少为 300 MB
  • EFI为分区选择挂载点非常重要/boot/efi。

这篇文章证实了我的选择,但没有解释为什么需要创建EFI分区。

安装程序说lubuntu 需要一个 EFI 分区,但另一条消息说如果没有EFI分区,系统可能无法启动;所以该EFI分区似乎不是强制性的。

另一篇文章说,如果缺少EFI分区并且系统中没有安装任何其他引导加载程序,则所有已安装的操作系统都无法启动。

问题

是否必须存在 EFI 分区(FAT32、300MB、安装在/boot/efi)才能正确启动 lubuntu 24.04?

boot
  • 3 个回答
  • 49 Views
Martin Hope
asylumax
Asked: 2025-03-06 22:28:24 +0800 CST

存在较旧版本的内核;为什么还要更新;20.04 至 22.04

  • 6

几个月前,我在我的两台机器上从 20.04 LTS 升级到了 22.04 LTS;我在 /boot 中看到了以下内容:

total 275864
drwxr-xr-x  5 root root      4096 Feb 26 06:51 .
drwxr-xr-x 20 root root      4096 Sep 29  2014 ..
-rw-r--r--  1 root root    262228 Feb  7 12:44 config-5.15.0-133-generic
-rw-r--r--  1 root root    287013 Jan 15 11:27 config-6.8.0-52-generic
drwx------  2 root root      4096 Dec 31  1969 efi
drwxr-xr-x  4 root root      4096 Feb 26 06:51 grub
lrwxrwxrwx  1 root root        29 Feb 26 06:48 initrd.img -> initrd.img-5.15.0-133-generic
-rw-r--r--  1 root root 114000628 Feb 26 06:49 initrd.img-5.15.0-133-generic
-rw-r--r--  1 root root 125713060 Feb 18 06:35 initrd.img-6.8.0-52-generic
lrwxrwxrwx  1 root root        27 Feb 26 06:48 initrd.img.old -> initrd.img-6.8.0-52-generic
drwx------  2 root root     16384 Nov 26  2020 lost+found
-rw-r--r--  1 root root    182800 Feb  6  2022 memtest86+.bin
-rw-r--r--  1 root root    184476 Feb  6  2022 memtest86+.elf
-rw-r--r--  1 root root    184980 Feb  6  2022 memtest86+_multiboot.bin
-rw-------  1 root root   6295053 Feb  7 12:44 System.map-5.15.0-133-generic
-rw-------  1 root root   8667805 Jan 15 11:27 System.map-6.8.0-52-generic
lrwxrwxrwx  1 root root        26 Feb 26 06:48 vmlinuz -> vmlinuz-5.15.0-133-generic
-rw-------  1 root root  11711400 Feb  7 13:12 vmlinuz-5.15.0-133-generic
-rw-------  1 root root  14928264 Jan 15 11:51 vmlinuz-6.8.0-52-generic
lrwxrwxrwx  1 root root        24 Feb 26 06:48 vmlinuz.old -> vmlinuz-6.8.0-52-generic

uname -r 返回:

6.8.0-52-generic

执行 sudo apt update 和 upgrade 时,版本 5.15 已更新(执行了 sudo apt autoremove 以删除旧版本,上面未显示)。知道为什么更新了这些内容吗?vmlinuz.old 指的是 6.8.0-52,但我当前的内核是 6.8.0-52?

kernel
  • 1 个回答
  • 20 Views
Martin Hope
BZab
Asked: 2025-03-06 18:42:39 +0800 CST

USB 集线器对下游端口具有独立的电源控制 - 系统可使其重新开启

  • 5

我正在编写一个小型 Python 模块,用于控制使用Cypress CY7C65631 (EZ-USB HX2LP) 芯片的 USB HUB。它所在的电路板有用于 VBUS 控制的外部 IC(所有启用和过流信号都连接到 HUB IC)和 GPIO Expander,让我可以监控上述线路上设置的逻辑值。

它运行在 Ubuntu 20.04.6 LTS 上,内核为 5.8(由 x86 主板制造商提供)。集线器由 PyUSB 的 ctrl 传输控制。与集线器的通信正常,系统正确识别集线器:

:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
Bus 001 Device 017: ID 0781:55b1 SanDisk Corp. Dell KB216 Wired Keyboard
Bus 001 Device 003: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
Bus 001 Device 002: ID 413c:2113 Dell Computer Corp. Dell KB216 Wired Keyboard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

为了测试目的,我将一个 U 盘(包含一些数据)连接到其中一个端口。我现在想要实现的是:

  1. 启用一切并读取数据
  2. 只关闭单个端口,然后观察操作系统是否没有看到 U 盘设备
  3. 重新启用端口,查看设备自动识别并重新读取数据。

当我尝试进行上述测试时,我可以观察到端口已正确关闭,但一段时间后(时间会有所不同,但一般在 0.5 秒到 2 秒之间)端口又打开了。我怀疑这与 USB 驱动程序或负责 USB 设备电源管理的内核模块有关,但我不知道它到底是什么以及如何禁用它(或更改我控制端口的方式)。

我从测试中删除了第 3 点,首先验证我是否能够成功关闭端口。以下是我用来运行测试的日志和部分代码。

Hub 的描述符:

:~$ lsusb -vvv -d 04b4:6560

Bus 001 Device 003: ID 04b4:6560 Cypress Semiconductor Corp. CY7C65640 USB-2.0 "TetraHub"
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x04b4 Cypress Semiconductor Corp.
  idProduct          0x6560 CY7C65640 USB-2.0 "TetraHub"
  bcdDevice            9.15
  iManufacturer           0 
  iProduct                2 EXTERNAL USB HUB
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              174mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x0089
    Per-port power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
    Port indicators
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0503 highspeed power enable connect
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

测试相关的部分dmesg(端口断电瞬间):

usb 1-3.2: USB disconnect, device number 16
[  +0.763930] usb 1-3.2: new high-speed USB device number 17 using xhci_hcd
[  +0.102990] usb 1-3.2: New USB device found, idVendor=0781, idProduct=55b1, bcdDevice= 1.10
[  +0.000009] usb 1-3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  +0.000005] usb 1-3.2: Product: SanDisk 3.2 Gen1
[  +0.000004] usb 1-3.2: Manufacturer: SanDisk
[  +0.000004] usb 1-3.2: SerialNumber: A20019FE2628A724
[  +0.001528] usb-storage 1-3.2:1.0: USB Mass Storage device detected
[  +0.000650] scsi host2: usb-storage 1-3.2:1.0
[  +1.012410] scsi 2:0:0:0: Direct-Access     SanDisk  SanDisk 3.2 Gen1 DL17 PQ: 0 ANSI: 6
[  +0.000876] sd 2:0:0:0: Attached scsi generic sg0 type 0
[  +0.000414] sd 2:0:0:0: [sda] 126124032 512-byte logical blocks: (64.6 GB/60.1 GiB)
[  +0.000524] sd 2:0:0:0: [sda] Write Protect is off
[  +0.000006] sd 2:0:0:0: [sda] Mode Sense: 45 00 00 00
[  +0.000618] sd 2:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  +0.082726]  sda: sda1 sda2
[  +0.002845] sd 2:0:0:0: [sda] Attached SCSI removable disk

测试代码的部分内容:

# b is the instance of the object abstracing the connected board
port_num = 2
print(b.external_usb_hub.get_port_status(port_num))
b.external_usb_hub.set_port_power(port_num, is_up=False)
print(b.external_usb_hub.get_port_status(port_num))
t = 0.
dt = 0.1
for _ in range(25):
    # read_hub_port_sig_n_ena reads the state of the input bit corresponding
    # to the ENA_n signal connecting the HUB Controller and the IC managing
    # the power on downstream ports. Signal ACTIVE means VBUS output is present.
    print(f"T = {round(t, 2)}: ", b.read_hub_port_sig_n_ena("external",port_num))
    sleep(dt)
    t += dt

class HUB:
    # get_port_status(...) is a beautified version of hub's method:
    def get_port_status_raw(self, port_num):
        return self.ctrl_transfer(
            bmRequestType=0xA3,
            bRequest=BRequest.GET_STATUS,
            wValue=0x0,
            wIndex=port_num,
            wLength=0x4,
        )
    
     def ctrl_transfer(
        self,
        bmRequestType,
        bRequest,
        wValue,
        wIndex,
        wLength=None,
        data=None,
        data_or_wLength=None,
    ):
        # Args verification omitted for clarity
        
        # self.dev is the instance returned by the usb.core.find(...)
        resp = self.dev.ctrl_transfer(
            bmRequestType=bmRequestType,
            bRequest=bRequest,
            wValue=wValue,
            wIndex=wIndex,
            data_or_wLength=data_or_wLength,
        )
        # Prevent timeouts with stacked xfers -- quick 'n dirty fix
        sleep(0.2)
        return resp

输出:

# Before disabling the port:
{'PortStatus.PORT_CONNECTION': 1, 'PortStatus.PORT_ENABLE': 0, 'PortStatus.PORT_SUSPEND': 1, 'PortStatus.PORT_OVER_CURRENT': 0, 'PortStatus.PORT_RESET': 0, 'PortStatus.PORT_POWER': 1, 'PortStatus.PORT_LOW_SPEED': 1, 'PortStatus.PORT_HIGH_SPEED': 0, 'PortStatus.PORT_TEST': 0, 'PortStatus.PORT_INDICATOR': 0, 'PortChange.C_PORT_CONNECTION': 0, 'PortChange.C_PORT_ENABLE': 0, 'PortChange.C_PORT_SUSPEND': 0, 'PortChange.C_PORT_OVER_CURRENT': 0, 'PortChange.C_PORT_RESET': 0}
# Right after disabling the port:
{'PortStatus.PORT_CONNECTION': 0, 'PortStatus.PORT_ENABLE': 0, 'PortStatus.PORT_SUSPEND': 0, 'PortStatus.PORT_OVER_CURRENT': 0, 'PortStatus.PORT_RESET': 0, 'PortStatus.PORT_POWER': 0, 'PortStatus.PORT_LOW_SPEED': 0, 'PortStatus.PORT_HIGH_SPEED': 0, 'PortStatus.PORT_TEST': 0, 'PortStatus.PORT_INDICATOR': 0, 'PortChange.C_PORT_CONNECTION': 0, 'PortChange.C_PORT_ENABLE': 0, 'PortChange.C_PORT_SUSPEND': 0, 'PortChange.C_PORT_OVER_CURRENT': 0, 'PortChange.C_PORT_RESET': 0}
T = 0.0:  GPIOExpState.INACTIVE
(...)
T = 1.2:  GPIOExpState.INACTIVE
# Here something toggles behind my back the power back on, port becomes enabled and device discovered
T = 1.3:  GPIOExpState.ACTIVE
(...)
drivers
  • 1 个回答
  • 58 Views
Martin Hope
Chris C.
Asked: 2025-03-06 12:54:35 +0800 CST

无法让 .desktop 启动器文件在 Ubuntu 24.04 中运行

  • 5

好吧,我已经为此苦思冥想了两个小时,并试图不将其作为问题发布,但我放弃了。我今天迁移到了新的 Ubuntu 24.04 安装,但我无法使我的 FaveProgram.desktop 文件工作。这些文件定义 GUI 启动器图标以运行特定的 CLI 命令(例如“faveprogram -option attribute”),我搜索、尝试、搜索、破解和测试,然后 aaaarrrrgghh...

当我“运行”图标时,它总是打开默认的文本编辑器。以下是我尝试过的方法:

  • 右击->作为程序运行
  • 右键点击->打开方式->运行软件
  • 在 GUI 中设置为可图形化执行文件
  • 使用 chmod 手动设置为可执行文件(已确认)
  • gio 设置 FaveProgram.desktop 元数据::trusted {yes true TRUE}(已全部尝试)
  • 注意:右键菜单中不提供“允许启动”!
  • 使用新的 .desktop 文件从头开始

我查看了 /var/log/syslog,它提到了有关 VTE 生成问题的内容。这可能是一个转移注意力的话题,但我提到它是为了防止有人对下一步有什么提示。

我开始尝试研究 xdg-mime,但我并不理解它。

以下是我尝试运行的 .desktop 文件的内容:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true   <-- normally false, tried true anyway
Exec=/usr/bin/program -option value   <-- yes it exists, can run manually
Name=FaveProgram
Comment=FaveProgram
Icon=/valid/path/to/icon.png

编辑:在这里找到了“编辑”链接,之前看不到。添加一些内容:

  • 感谢管理员@mook765 快速编辑此问题以格式化我的代码
  • 我确实尝试删除 xdg-open,但没有改善
  • 我之前一直通过 Nautilus / Files / 文件管理器从任意文件夹运行这些图标,而不是从 GUI 菜单运行;重新使用 XDG 应用程序文件夹,我应该尝试哪一个?
  • 谢谢@david;我确实尝试了该帖子中建议的第一种方法,但没有奏效,很快就会转向其他方法

如果系统日志中的 VTE 错误导致问题,那么当我尝试“作为程序运行”时会出现以下错误:

  • 2025-03-06T15:58:58.273700-05:00 shuttle4 systemd [1379]:vte-spawn-8a9d9df0-2262-4e79-b9be-15b00bcdf6b5.scope:PID 48562 在我们将其移动到目标 cgroup'/user.slice/user-1000.slice/ [email protected] /app.slice/app-org.gnome.Terminal.slice/vte-spawn-8a9d9df0-2262-4e79-b9be-15b00bcdf6b5.scope'之前消失,跳过:没有这样的过程
  • 2025-03-06T15:58:58.273830-05:00 .... 没有剩余的 PID 可附加到范围的控制组,拒绝
  • (另加两行,字数有限)
command-line
  • 2 个回答
  • 131 Views
上一页
下一页

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve