Ubuntu 22.04.1 LTS,无法安装 .deb 文件

Ubuntu 22.04.1 LTS,无法安装 .deb 文件

当我尝试安装 nRF 命令行工具时。

下载安装文件后nrf-command-line-tools_10.17.0_amd64.deb,我将权限更改为可执行
-rwxrwxrwx 1 r0n9 r0n9 45888940 Aug 3 20:36 nrf-command-line-tools_10.17.0_amd64.deb*
但是当我./nrf-command-line-tools_10.17.0_amd64.deb在终端中运行时,出现错误:

./nrf-command-line-tools_10.17.0_amd64.deb: line 1: syntax error near unexpected token `newline'
./nrf-command-line-tools_10.17.0_amd64.deb: line 1: `!<arch>'

尝试使用 dpkg 安装该包

sudo dpkg -i ./nrf-command-line-tools_10.17.0_amd64.deb,我收到以下错误

(Reading database ... 365623 files and directories currently installed.)
Preparing to unpack .../nrf-command-line-tools_10.17.0_amd64.deb ...
Unpacking nrf-command-line-tools (10.17.0) over (10.17.0) ...
Setting up nrf-command-line-tools (10.17.0) ...
dpkg: error: dpkg frontend lock was locked by another process with pid 3565
Note: removing the lock file is always wrong, and can end up damaging the
locked area and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ>.
dpkg: error processing package nrf-command-line-tools (--install):
 installed nrf-command-line-tools package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 nrf-command-line-tools

但是当我尝试使用查找该过程时,ps ax | grep 3565我得到了一个结果:
5507 pts/0 S+ 0:00 grep --color=auto 3565
浏览时,ps ax我发现没有列出这样的过程

...
   3224 ?        Sl     0:01 /usr/bin/nautilus --gapplication-service
   3341 ?        S      0:00 /usr/bin/python3 /usr/bin/gnome-terminal --wait
   3344 ?        Sl     0:00 /usr/bin/gnome-terminal.real --wait
   3347 ?        Ssl    0:01 /usr/libexec/gnome-terminal-server
   3375 pts/0    Ss     0:00 bash
   3588 ?        Sl     0:00 update-notifier
   3629 ?        SLl    0:12 /opt/google/chrome/chrome --enable-crashpad
   3635 ?        S      0:00 cat
   3636 ?        S      0:00 cat

...

尝试盲目地终止该过程,我得到了:

sudo kill -9 3565 
kill: (3565): No such process

编辑0:运行结果sudo apt install

sudo apt install ./nrf-command-line-tools_10.17.0_amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'nrf-command-line-tools' instead of './nrf-command-line-tools_10.17.0_amd64.deb'
nrf-command-line-tools is already the newest version (10.17.0).
The following packages were automatically installed and are no longer required:
  linux-headers-5.15.0-39 linux-headers-5.15.0-39-generic linux-image-5.15.0-39-generic
  linux-modules-5.15.0-39-generic linux-modules-extra-5.15.0-39-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nrf-command-line-tools (10.17.0) ...
dpkg: error: dpkg database lock was locked by another process with pid 8814
Note: removing the lock file is always wrong, and can end up damaging the
locked area and the entire system. See <https://wiki.debian.org/Teams/Dpkg/FAQ>.
dpkg: error processing package nrf-command-line-tools (--configure):
 installed nrf-command-line-tools package post-installation script subprocess returned error exit st
atus 2
Errors were encountered while processing:

和 BAU:

ps ax | grep 8814
10569 pts/0    S+     0:00 grep --color=auto 8814

编辑1: 尝试了所有答案dpkg:错误:dpkg 状态数据库已被另一个进程锁定,没有什么能解决这个问题。

我也尝试过重启电脑,但重启后仍然出现同样的问题。有什么建议可以解决这个问题吗?

相关内容