【问题标题】:Couldn't update and download any package in bash for windows无法在 bash for windows 中更新和下载任何包
【发布时间】:2020-02-01 10:01:39
【问题描述】:

我正在尝试将官方 bash 用于 Windows 64 位(ubuntu 14.04)。问题是,当我尝试更新任何软件包或安装新软件包(例如 g++ 等)时,我总是会遇到同样的错误:

root@notebook:~# sudo apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:5.3.1-1ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 2 not to upgrade.
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 qemu-user-binfmt (1:2.5+dfsg-5ubuntu10.41) ...
update-binfmts: warning: unable to close /proc/sys/fs/binfmt_misc/register: Invalid argument
update-binfmts: warning: unable to enable binary format qemu-aarch64
update-binfmts: exiting due to previous errors
dpkg: error processing package qemu-user-binfmt (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 qemu-user-binfmt
E: Sub-process /usr/bin/dpkg returned an error code (1)

【问题讨论】:

  • qemu-user-binfmt 包脚本错误。首先你需要尝试 cmd:apt-get purge qemu-user-binfmt。如果问题未解决,您需要删除目录 /var/lib/dpkg/info/ 中的文件 qemu-user-binfmt.pre*、qemu-user-binfmt.post*。并运行 apt-get remove qemu-user-binfmt。
  • @Šerg 谢谢。它有帮助。你能把你的解决方案写成答案吗?我会接受的。

标签: bash ubuntu ubuntu-14.04 windows-subsystem-for-linux


【解决方案1】:

qemu-user-binfmt 包脚本错误。

首先你需要尝试 cmd:

apt-get purge qemu-user-binfmt

如果问题没有解决,您需要删除目录 /var/lib/dpkg/info/ 中的文件:

qemu-user-binfmt.pre*
qemu-user-binfmt.post*

然后运行

apt-get remove qemu-user-binfmt

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-18
    • 1970-01-01
    • 2019-03-18
    • 2012-05-16
    • 1970-01-01
    • 1970-01-01
    • 2020-09-07
    • 1970-01-01
    相关资源
    最近更新 更多