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 / 问题

问题[executable](ubuntu)

Martin Hope
POT
Asked: 2023-07-06 02:55:17 +0800 CST

无法运行可执行文件(应用程序/x-可执行文件)[重复]

  • 5
这个问题在这里已经有了答案:
如何在 Nautilus 中运行可执行脚本? (11 个回答)
7 小时前关闭。

我是 Ubuntu 新用户,我想通过 USB 在手机上传输系统声音。我下载了 soundwire,这是一个可以让我们做到这一点的程序。我在我的其他 Linux 发行版上测试了它并且能够运行它。但我无法在 Ubuntu 中运行它。它的“可执行(程序/x-可执行)”文件。请帮我 。

executable
  • 1 个回答
  • 19 Views
Martin Hope
jenda
Asked: 2021-02-05 12:22:27 +0800 CST

重新创建 Ubuntu 安装以运行未知的二进制文件

  • 0

我可以访问 Ubuntu 16.04 安装,它能够运行某个二进制文件(它是使用未知参数编译的LPMud的某个版本),但我无法在不同的 Ubuntu 16.04 安装上运行相同的二进制文件 - 在第二个系统二进制文件因分段错误而失败。

我对制作第一个系统的精确副本并不感兴趣——我想知道运行二进制文件究竟需要什么,所以我可以创建一个最小的 Ubuntu 安装,它可以运行二进制文件。

最好的方法是什么?我正在考虑提取已安装软件包的列表(使用apt list --installed)和/etc目录,在第二个系统中重新安装软件包并复制/etc目录。

我知道,为什么二进制文件可以在不同的系统上出现段错误有很多原因,但我想在尝试从逐位副本缩小环境范围之前尝试一些数据密集度较低的方法。

这是一个合理的方法吗?有谁知道如何提高成功的机会?


编辑 - 有关二进制文件的更多信息:

$ file driver
driver: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, stripped
$ ldd driver
       statically linked
$ gdb driver
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/mud/bin/driver": not in executable format: File format not recognized

尝试使用 32 位版本的 gdb 进行调试会带来类似的结果:

$ gdb driver
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
"/mud/bin/driver": not in executable format: File format not recognized
(gdb) show configuration
This GDB was configured as follows:
   configure --host=i686-linux-gnu --target=i686-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-python=/usr (relocatable)
             --without-guile
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --with-system-gdbinit=/etc/gdb/gdbinit
             --with-babeltrace

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)
(gdb) 
$ strace -o ./log ./driver ; cat ./log
execve("./driver", ["./driver"], [/* 9 vars */]) = 0
brk(NULL)                               = 0x8952000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf7f89000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
set_thread_area({entry_number:-1, base_addr:0xf7f89a80, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 (entry_number:12)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x4} ---
+++ killed by SIGSEGV (core dumped) +++
executable
  • 1 个回答
  • 98 Views
Martin Hope
sam
Asked: 2020-08-14 22:30:15 +0800 CST

我在哪里可以找到exe安装的文件?

  • 1

我在哪里可以找到exe安装文件,因为我正在使用wine安装exe文件

wine executable
  • 2 个回答
  • 288 Views
Martin Hope
Ritesh Singh
Asked: 2020-07-18 19:26:01 +0800 CST

为什么 ./a.out 有效,但 a.out 无效?[复制]

  • 2
这个问题在这里已经有了答案:
为什么在当前目录中执行程序之前需要输入`./`? (11 个回答)
为什么在 Unix 中使用“./”来运行“.sh”脚本?[重复] (2个答案)
2年前关闭。

在我看来,即使是a.out终端上的一个简单的文件也包含有关当前目录中文件的完整信息。重申它./a.out似乎是多余的。

为什么我们需要指定文件在当前目录中才能执行呢?

command-line gnome-terminal executable execute-command
  • 3 个回答
  • 711 Views
Martin Hope
Div
Asked: 2020-07-10 23:01:40 +0800 CST

-bash: ./geth: 无法执行二进制文件:执行格式错误

  • 0

有很多同名的问题,但是,我检查了二进制版本和操作系统版本。两者都是相同的,因此在这里提出这个问题。

我在谷歌云(ubuntu 16.04 LTS)上创建了一个虚拟机,并尝试使用二进制文件安装 geth 并遇到错误。

-bash: ./geth: cannot execute binary file: Exec format error

文件版本

> file geth

geth: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=4b7c90f77d16087e2d4d36072864ba7585659fba, not stripped

操作系统版本

> dpkg --print-architecture

amd64

我遵循的步骤

sudo tar -xvf <geth_tar_file>

sudo chmod +x geth

./geth version

所以,我的问题是,这个错误的原因是什么以及如何解决它?

bashrc executable 16.04
  • 1 个回答
  • 1455 Views
Martin Hope
Vardogor
Asked: 2020-04-27 08:59:58 +0800 CST

让 KDE 忽略文件扩展名并将 .exe 作为 Linux 可执行文件运行

  • 1

我敢肯定你想知道我为什么要这么做。我想运行一个 Steam 游戏(具体来说是 Doom 3),我可以强制它下载,因为 Steam 现在使用 Proton 来兼容,但我希望能够使用社区源端口,它使用本机 Linux 可执行文件,同时仍在 Steam 中记录我的时间。所以,我从 Steam 下载了 Doom 3,然后从源端口复制了文件。然而,Steam 只能指向“Doom3.exe”,并且 Kubuntu 中没有选项可以将文件名与文件类型断开连接,因此将源端口的可执行文件重命名为 Doom3.exe 并从 Steam 启动不起作用,使用它尝试将其作为 Windows 可执行文件启动。我确实在文件的属性中找到了“文件类型选项”,但是“* .exe” 删除后立即返回条目。我希望我可以编写某种脚本来完成这项工作,如果能得到任何帮助,我将不胜感激。当然,我可以在没有 Steam 的情况下玩它,但我非常想计算我的时间。

steam executable filename
  • 1 个回答
  • 190 Views
Martin Hope
Dr Drill
Asked: 2020-01-23 18:57:01 +0800 CST

加载共享库时出错(文件:magfieldmapper_gui)

  • 1

我是 unbuntu 的新手。如果可能的话,请帮助我解决这个问题。我在网上阅读了许多解决方案,但我很难理解大多数人写的内容。

我试图从终端运行可执行文件,但这是随后出现的错误消息。

./magfieldmapper_gui: error while loading shared libraries: liblapacke.so.3: cannot open shared object file: No such file or directory

请指教。感谢您的时间。

libraries shared-library executable 18.04
  • 1 个回答
  • 11599 Views
Martin Hope
BingBong
Asked: 2020-01-12 07:13:16 +0800 CST

使可执行的 bash 脚本以 sudo 权限运行?

  • 3

Ubuntu 18.04 侏儒德。

我制作了一个简单的 bash 脚本文件,标记我下次重新启动以选择 windows grub 条目。用于直接从 Linux DE 快速重新启动到 Windows。

问题是我必须使用 dconf 修改可执行文件来询问,所以我可以在终端中单击运行,它会自动询问密码。否则,只执行文件什么都不做,因为它正在等待密码输入。

有没有办法以固有的 sudo 权限运行这样的 bash 脚本文件,因此它不需要询问密码?

编辑(即使它是针对@waltinator,因为评论格式很糟糕):

也会

/bin/kill

是我的 bash 脚本文件的位置和名称吗?例如,我的 bash 脚本文件名为 restart2windows 并且位于我的桌面上:

/home/myusername/Desktop/restart2windows

所以我只需要将这一行添加到 /etc/sudoers (我仍然不清楚使用 visudo 编辑该文件,以及是否应该按照建议编辑 sudoers.d):

myusername     mymachinename = NOPASSWD: /home/myusername/Desktop/restart2windows

这是正确的吗?

编辑 2

我尝试通过 visudo 编辑 sudoers:

sudo visudo

并在注释行下方添加了我上面建议的行:

#includedir /etc/sudoers.d

然后尝试从我的桌面运行我的 bash 脚本文件,但它什么也没做。如果我选择在终端中运行它,终端正在等待密码输入。

这是我的 bash 脚本文件内容,很简单:

#!/bin/bash
sudo grub-reboot 2
sudo reboot now

在这里发现了这个问题,看来我需要在某处添加 sudo ?我对这个问题的答案感到困惑,因为他来自 OP 的代码行与 OP 不匹配。

编辑3:

我也在 Ubuntuforums.org 上提交了同样的帖子:https ://ubuntuforums.org/showthread.php?t=2434878

scripts bash executable
  • 1 个回答
  • 3632 Views
Martin Hope
N0rbert
Asked: 2019-12-16 02:26:50 +0800 CST

如何获得作为 FlatPak 应用程序启动的窗口的可执行文件路径?

  • 4

我知道

xprop | awk '/PID/ {print $3}' | xargs ps

和

xprop | awk '/COMMAND/ {print $4}' | xargs which

与 deb 打包、AppImage'd 或 Snap'd 的 GUI 应用程序配合使用非常好。

但是这种方法没有为打包为 FlatPak 的应用程序提供可执行文件名。
请参见下面的示例:

$ flatpak run org.libretro.RetroArch

$ xprop 
_NET_WM_VISIBLE_NAME(UTF8_STRING) = "RetroArch   (as superuser)"
WM_NAME(STRING) = "RetroArch  "
_NET_WM_ICON_GEOMETRY(CARDINAL) = 446, 744, 207, 24
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW
XKLAVIER_STATE(INTEGER) = 0, -180379392
_NET_WM_STATE(ATOM) = 
WM_STATE(WM_STATE):
      window state: Normal
      icon window: 0x0
_NET_FRAME_EXTENTS(CARDINAL) = 3, 3, 23, 3
_NET_WM_DESKTOP(CARDINAL) = 0
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW
WM_CLIENT_MACHINE(STRING) = "norbert-UX32A"
_NET_WM_PID(CARDINAL) = 2
WM_CLASS(STRING) = "retroarch", "retroarch"
_NET_WM_ICON(CARDINAL) =  Icon (16 x 16):
                  
    ▓▓▓▓▓▓▓▓▓▓▓   
   ▓▓▓▓▓▓▓▓▓▓▓▓▓  
   ▓▓▓▓▓▓▓▓▓▓▓▓▓  
   ▓▓▓ ▓▓▓▓▓ ▓▓▓  
   ▓ ▓▓ ▓▓▓ ▓▓ ▓  
   ▓ ▓       ▓ ▓  
   ▓   ▓   ▓   ▓  
   ▓           ▓  
   ▓▓         ▓▓  
   ▓▓▓ ▓▓▓▓▓ ▓▓▓  
   ▓▓ ▓▓▓▓▓▓▓ ▓▓  
   ▓▓▓▓▓▓▓▓▓▓▓▓▓  
   ▓▓▓▓▓▓▓▓▓▓▓▓▓  
    ▓▓▓▓▓▓▓▓▓▓▓   
                  

所以我在xprop输出中看不到 PID 或命令相关的行。但当然它是启动的:

$ flatpak ps
Instance  PID   Application            Runtime
752290322 23857 org.libretro.RetroArch org.kde.Platform

如何获取 FlatPak 应用程序在使用时创建的窗口的 PIDxprop或wmctrl类似的东西?

window-manager executable window flatpak xprop
  • 1 个回答
  • 831 Views
Martin Hope
NotNotLogic
Asked: 2019-11-07 04:01:05 +0800 CST

如何在不使用 cd 或修改 PATH 的情况下从不同的目录运行可执行文件?

  • 0

存在类似于我想问的变化,但我找不到确切的问题,所以我会在这里问。

假设我有一个编译.c文件,导致可执行文件ex位于/mnt/f/C_F/ex. 我可以很好地从内部执行它/mnt/f/C_F,./ex但是如果我想从/mnt/f说(或任何目录)中执行它怎么办。我不想为此添加/mnt/f/C_F/到 PATH 中。

我找不到解决方案,我想不可能这样做。请确认。

command-line bash paths executable
  • 3 个回答
  • 6254 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